Put to upload file
Dan7312
Registered Users Posts: 1,330 Major grins
I am able to upload files using the 1.2.0 api but I'm want to understand a bit more about the api for uploading.
What is the relationship between the file being PUT and the name in the X-Smug-FileName header?
For example:
"http://upload.smugmug.com/test.jpg
and
conn.setRequestProperty("X-Smug-FileName", "test1.jpg");
What if these names are different? Where is the X-Smug-FileName header even needed?
It seems like it doesn't matter what the file name in the url is.
Thanks,
Dan
What is the relationship between the file being PUT and the name in the X-Smug-FileName header?
For example:
"http://upload.smugmug.com/test.jpg
and
conn.setRequestProperty("X-Smug-FileName", "test1.jpg");
What if these names are different? Where is the X-Smug-FileName header even needed?
It seems like it doesn't matter what the file name in the url is.
Thanks,
Dan
0
Comments
Whatever is set as the X-Smug-FileName overrides the filename used in the PUT url, but it's an optional parameter it doesn't need to be set.
Cheers,
David
SmugMug API Developer
My Photos
After some experimentation I found you do have to include a file name in the url even if it is overridden by the http header.
http://www.danalphotos.com
http://www.pluralsight.com
http://twitter.com/d114