How can i get the absolute path of an uploaded file (that has been uploaded by input file
) and use it as a <video>
.
Asked
Active
Viewed 136 times
0

cvcvka5
- 57
- 1
- 7
-
1That's a question of your backend set up – sebastian-ruehmann Jun 21 '20 at 13:01
-
If you wanna know the path of the client that uploads that video, basicly you cant, it's a security feature that all browsers adapt. – mmonteirocl Jun 21 '20 at 13:03
-
oh can i change the speed of an uploaded file and then download it without getting the filepath? – cvcvka5 Jun 21 '20 at 13:06
1 Answers
1
For security reasons, you cannot get the absolute path of a file picked from a file picker in front-end JavaScript. That would allow websites to potentially see private information, such as the user's name and their operating system. Also, a user might not want the website to see their folder structure and the names of their folders.
Here is a way of using a file picked for a <video>
tag (You don't need to know the full path of file). I didn't make this, but it will probably help you: http://jsfiddle.net/dsbonev/cCCZ2/
How it works is you create a object url.
var fileURL = URL.createObjectURL(fileFromFilePicker);
Then you can set the src
attribute of the <video>
tag.
If you don't want to actually upload the file, then your question has already been asked and answered here.

programmerRaj
- 1,810
- 2
- 9
- 19