in reply to Seeking help with HTTPS form upload.

A common problem when uploading files is to show the user feedback about the progress of the upload. The browsers don’t have this capability, so people usually resort to running ajax requests in parallel to ask the server on a second connection how much data was received so far on the first connection. In order to ask about he first connection, there needs to be some kind of ID to reference it.

Since you say javascript generated a UUID, they probably implemented this by just accepting whatever ID the client provides on the upload, then the other progress checks can refer to that. Their system might depend on the string being unique. It’s pretty easy to generate a random string in Perl, so just make your own UUID that looks like the one JavaScript builds.

  • Comment on Re: Seeking help with HTTPS form upload.

Replies are listed 'Best First'.
Re^2: Seeking help with HTTPS form upload.
by FeistyLemur (Acolyte) on Oct 13, 2021 at 16:42 UTC

    As it turns out you're correct, the string numbers are unimportant to the server. I got past this step today. As it turns out the content type was all I overlooked and needed to be set along with the file. It was defaulting to application/octet-stream and needed to be application/x-raw-disk-image.

Re^2: Seeking help with HTTPS form upload.
by Bod (Parson) on Oct 13, 2021 at 21:07 UTC
    people usually resort to running ajax requests in parallel to ask the server on a second connection how much data was received so far on the first connection

    An alternative approach that I prefer is to use an AJAX request to perform the upload. Using XMLHttpRequest an event handler can be added to the request object to then show the progress something like this:

    xhr.upload.addEventListener('progress', function(ev) { document.getElementById('progbar').value = ev.loaded * 100 / ev.to +tal; });
    Where progbar is an HTML progress element.