[Fixed]-Django Upload file get full name and file path

1👍

Browsers do not tell what directory the files come from.
They do not even give that information to the scripts on the page.

When a user uploads a file, you may know:

  • Its basename.
  • Its size.
  • Its type (usually guessed from extension).
  • Its modification time.

This is all you will get, regardless of whether you access the information straight from the browser’s <input> element, or wait for it to POST it.

You may also turn this answer the other way around: if you really need to be able to post the full path of the file, you need to develop a client-side application that will send it. It could be a standalone executable, a browser addon/app, or a Java applet, whatever as long as it runs outside of the webpage sandbox.

I do not use dropbox, but I believe you need to download and install some additional software to use it. That’s how it would access the full path of your files.

Leave a comment