What happens when an API post upload is interrupted?
rutt
Registered Users Posts: 6,511 Major grins
In testing my new script, I've had some experiences with interrupting it once it gets going doing the wrong thing. The result seems to be a partial photo on the gallery. What is supposed to happen when the client drops the connection in the middle of an upload.
I think that using the "old style" post (decoded from smugmug pages with some help from Don) the photo wouldn't show up unless the upload actually completed.
Or am I missing something?
I think that using the "old style" post (decoded from smugmug pages with some help from Don) the photo wouldn't show up unless the upload actually completed.
Or am I missing something?
If not now, when?
0
Comments
All smugmug methods result in a partial photo being processed. Part of the problem is that it's not really easy to tell whether we received the entire photo or not, particularly because there are people who have corrupt photos that they really do want up on smugmug even in their corrupt state (it's all they have left).
So yes, this is expected behavior. It happens with all of our uploaders, and it's by design since I can't think of another way to allow corrupted JPGs through without also allowing partial uploads.
Don
That's an interesting idea. I could probably easily send back, say, a byte count and an md5 sum.
Then your app could reply with a "Delete" request (once it's exposed), if they don't match up.
I suppose we could front-load it at some point too, whereby you send along an md5 sum and a bytecount in the initial POST and I compare before adding it to our DB. Doing both is probably wise, so we cover all bases.
More as I think and test...
Don
"ByteCount" and "MD5Sum" are now options for uploading and should solve this problem nicely.
See the docs for more info.
Don
Very nice! Would be fun to use it!
Cheers!