filename is used but was never set. I'm not familiar with go, but I'm guessing this variable likely contains an empty string here, possibly whatever was last in local memory where it's allocated.
When copying to python, I figured it was safer and clearer to give this parameter the actual filename, but I don't know for sure if that is the correct behavior. Does the server ignore the filename parameter when there is one named multipart file? Does it fill it in automatically when it's empty? Or is this a bug?
I've seen in my metadata queries that many records do have the filename listed twice: once on the whole record, and again within the content alongside the size. So I figured the query parameter might set the outer name, but I don't really know. Is this documented concisely somewhere?
I was copying some of the upload interface into the python sdk, and I noticed that when only one file is being uploaded, the
filename
url parameter is passed but not given any content. It's around this area of code. https://github.com/NebulousLabs/go-skynet/blob/c2e7fd3bc47fc9e5564aa5ca2a17512e09c08f52/upload.go#L79If you look at that if block, you'll see only
fieldname
is set, unlike the else condition, but right below there is: https://github.com/NebulousLabs/go-skynet/blob/c2e7fd3bc47fc9e5564aa5ca2a17512e09c08f52/upload.go#L90filename
is used but was never set. I'm not familiar with go, but I'm guessing this variable likely contains an empty string here, possibly whatever was last in local memory where it's allocated.When copying to python, I figured it was safer and clearer to give this parameter the actual filename, but I don't know for sure if that is the correct behavior. Does the server ignore the filename parameter when there is one named multipart file? Does it fill it in automatically when it's empty? Or is this a bug?
I've seen in my metadata queries that many records do have the filename listed twice: once on the whole record, and again within the content alongside the size. So I figured the query parameter might set the outer name, but I don't really know. Is this documented concisely somewhere?
EDIT: I've significantly reworded the above.