Is it possible for a web application to read local files, and display them without having to upload them?
I know that when I upload something, web browser can show me the file picker and let me choose the file. Can someone enlighten me on this?
Is it possible for a web application to read local files, and display them without having to upload them?
I know that when I upload something, web browser can show me the file picker and let me choose the file. Can someone enlighten me on this?
No. Modern browsers do not allow you to access local file or local file structure. It is a security vulnerability. Browser security is pretty tight, and getting tighter. Local file:// access is usually permitted if you run the browser App from the local file system, and not through an HTTP server.
It is possible. However, the user may be viewing the page from any OS or browser, making this almost impossible. The user would have to have the file you want to display in one directory as a specific filename and filetype. You would even have to have a specific user account name. It would only work in one OS - windows, in my example.
<embed src="file:///C:/users/user/filename.exe">
<img src="file:///C:/Users/User/photos/picture.jpg">
I don't know if you could add in variables in php like $path and $filetype set in a form using
echo("embed src='$path/$filename') I didn't add the html code blocks becuase It would't show up. Also, in php make sure html code blocks have ' instead of " because it will read as the end of code.
(I don't know much about php - if I made a mistake, sorry.)