How to tell if upload file was modified after selected

Viewed 92

I am uploading a file to an API using formData() and ajax using jquery/javascript on chrome. If a user selects the file to upload but then modifies and saves the file, it will fail. On the console I get "net::ERR_UPLOAD_FILE_CHANGED" however in my ajax error section I get a Status of 0 and the call never even makes it to the API.

I would like to check the file before making the ajax call and let the user know before uploading that the file was modified or if that's not possible wanted to know if there was a better way than checking if status = 0. I noticed that I can use formData() to see the lastModified time which is the time before any alteration are made. Does anyone know how I could get the other "last modified" time that the browser uses and compare the two?

0 Answers
Related