In my app I upload a file to the server using HTML5 File API, however I am encountering a situation where a file is not accessible because it is being used by another process. This actually creates two different error conditions in firefox and in chrome. Is there a way to detect if a file is inaccessible using html5?
Asked
Active
Viewed 171 times
0
-
1Have you looked the sample in this link which shows how you can read a file and in case of error you can write proper error handler: http://www.azoft.com/spotlight/2011/02/02/filesystem-apifile-api.html – AvkashChauhan May 22 '12 at 20:19
-
Thanks for the comment! That will work, however currently I am not reading the file locally, only slicing it and sending it to the server. I was wondering if there's an API call to just check if it is readable without actually having to read it locally... – Tamar May 23 '12 at 13:24
1 Answers
0
Have you looked the sample in this link which shows how you can read a file and in case of error you can write proper error handler:
http://www.azoft.com/spotlight/2011/02/02/filesystem-apifile-api.html
About your second questions "if there's an API call to just check if it is readable without actually having to read it locally", I verified that there is no such API to just get the file handle state and verify it. I think it could be because (but i may be wrong):
- the web application runs on any box with limited privilege and getting file handle could require SYSTEM level access
- The file handle access could be different for different OS (Linux or Windows)

AvkashChauhan
- 20,495
- 3
- 34
- 65
-
I had hoped to avoid reading the file (like in the sample) but eventually I do read it to find out if it accessible, thanks! – Tamar May 23 '12 at 18:15