Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to append data to existing files #6

Open
fjgarlin opened this issue Nov 19, 2015 · 1 comment
Open

Ability to append data to existing files #6

fjgarlin opened this issue Nov 19, 2015 · 1 comment

Comments

@fjgarlin
Copy link

It'd be great to add an optional parameter in Spreadsheet::save to append the contents of the current export to an existing file. This parameter would just add the flag FILE_APPEND to the function file_put_contents.

@mburtscher
Copy link
Member

The current architecture does not allow such a behavior. I'll try to explain:

Writers are meant to return the content of the target file as a string since it may be sent direct over the wire with the download() method or saved to a file with the save() method. So the writer does not know whether the content will be added to a file or saved to a new file while creating the export.

For CSV and TSV it would work to just append the newly created content at the end of the file, but it won't work for more complex writers such as the ODS writer which creates a ZIP file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants