0

I am trying to build a web application which can do this: 1. Through the web application User selects some files present on his machine's filesystem. 2. Web application then extracts metadata of selected files like filename, size, filetype and stores it in a database at server.

So I need two things - 1. web app should be able to access the filesystem of user and 2. web app should be able to extract metadata of selected files.

Is it possible to do this?

Thanks!

  • Don't you want to upload those files first? Or try to read this http://stackoverflow.com/questions/371875/local-file-access-with-javascript – s.webbandit Apr 06 '12 at 12:35

3 Answers3

0

The webserver cannot access the users file system to get this meta information without the help of browser plugins. The only way this information becomes accessible to the server is after the upload is complete.

Shoan
  • 4,003
  • 1
  • 26
  • 29
0

Yes, http://jsfiddle.net/Fs7dM/2/

$("input").bind("change", function(e) {
    var files = this.files;

    if (files && files.length) {
        var pre = $("#log");
        [].forEach.call(files, function(file) {
           pre.append( (file.fileSize || file.size) + " " + (file.fileName || file.name) + " " + file.type +"\n");
        });
    }
});​
Esailija
  • 138,174
  • 23
  • 272
  • 326
0

If uploads are made,then it is possible to directly access the file name,size,path,last modified date and file type using javascriot(html 5 file api). Otherwise,for all extreme metadata(bitrate and image dimensions,etc.) one has to used a php interface.

Shubham Lalwani
  • 83
  • 4
  • 11