0

I have a simple form with input

It works nice but I also want to add file to be uploaded by copying it and paste into browser using CTRL+V. How to do it?

Regards

3

1 Answer 1

1

You cannot directly access the file system unless the user specify the file explicitly. Copy and paste doesn't fall in to this category.

You can use latest html5 drag and drop and create a drop zone to upload files.

Please see this answer for other external options.

Sign up to request clarification or add additional context in comments.

2 Comments

I do not want to upload file but read its source only from clipboard
Javascript cannot read file system content by the path. But it can by the user action - that is when the user selects the file and say "here it is". You are good to go with HTML5 fileReader API if that happens. Copying and pasting doesn't guarantee that level of security.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.