-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Function SaveTo to save file to writer #744
Comments
Any update on this from the contributors? |
This library has added the WriteTo function since version 1.4.1, which can be used to save the file to the writer. I will add options support for it recently. |
Thanks for the quick reply @xuri I see the functions but they don't seem to set the contentType using the file extension as |
Okay, thanks for your feedback. I will add support for it at this week. |
I can create a proposal PR. Against v2 or master? |
I have fixed this issue. Now the |
Heads up for anyone who might've had the same issue as me related to this! I've just upgraded to I've had to implement this wrapper type to get it to work again: package server
import (
"io"
"github.com/xuri/excelize/v2"
)
type fileWriterTo struct {
*excelize.File
}
// WriteTo implements io.WriterTo
func (f *fileWriterTo) WriteTo(w io.Writer) (n int64, err error) {
return f.File.WriteTo(w)
}
func wrapFileWriteTo(f *excelize.File) io.WriterTo {
return &fileWriterTo{f}
} |
Hi,
it would be great to have possibility to pass unlocked file to io.Writer interface.
Use case:
Web service downloads excel files from cloud storage and processes it. In case excel file is password protected, service should unlock it with provided password and upload unlocked file back to cloud storage.
Description
Current implementation allows to save unlocked filed to the file on file system via:
func (f *File) SaveAs(name string, opt ...Options) error
New function SaveTo would allow to upload unlocked file without persisting it on file system.
func (f *File) SaveTo(w io.Writer, opt ...Options) (int64, error)
Other option would be to allow reset options in order to save unlocked file using:
Thanks!
The text was updated successfully, but these errors were encountered: