Is there any method to return the URL of the chosen file in a "file" input element?

Asked

Viewed 25 times

-2

What I would like is that, for example, by clicking on the entry element of the type file (input type="file") he would return me to URL complete of the file the user has chosen, just this! for later subsequent I put in my application I am developing, but for that I need to know if there is any method or property in the Javascript that returns me to URL of the chosen file.

1 answer

0

No. When you choose a file through a input[type="file"], the browser makes available the bytes of that file to be sent to a server on the web. There is no native way to upload this to the web and generate a URL.

What you can do is an application that receives this file via upload, saves it to a public directory on the web and returns the full URL (domain + directory + file name).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.