1

I need to make new own file upload field using HTML and Javascript since Built-In file upload not showing full path of the file

I need to make it similar to file upload by using button and textbox

please help to solve this problem

3 Answers 3

4

You can't.

There are security considerations browsers must adhere to and there is now way around that.

FYI this is also why Firefox doesn't allow drag and drop into a file field.

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

Comments

1

Just fyi, I think the path display depends on your browser.

If you're willing to/can do so, java (not javascript) might be able to help you with your original problem. Java brings it's own problems, though.

Comments

0

The file upload is a specific input type, which you can't easily replace, but in some browsers you may be able to style it.

You should be able to access the filename from javascript, and display this in a different part of the page (possibly hiding the file input at the same time) so the user can see what will be selected.

Another option is to use Flash for a fancier front-end (see http://www.flickr.com/photos/upload/ (assuming you have a flickr account) as an example), but I've never used one of these as a developer

1 Comment

You'll get fake path: "C:\fake\filename.extension"

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.