Given a multipart.File, how would you go about finding the size of the file, while still retaining the multipart.File itself?os.File has Stat(), but multipart.File doesn't have anything of the sort.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Just to clarify, I do also need to know it's exact size in number of bytes also.
Ah, I see. Though I've been doing something akin to that for a while to be honest.What I'm struggling with is the fact that I still need to use the file for other things such as retrieving it's dimensions using the image package and sending it as a file to amazon s3 - using http://godoc.org/github.com/kr/s3#Sign.In your example, the file is no longer usable - I think - as it's contents has been read into that byte array...
err.. one last question...The bytes.Reader doesn't seem to be usable as a io.Reader, keep getting: cannot use (type bytes.Reader) as type io.Reader in function argument.