I need to know how to fetch file field’s file name into textbox using Rails and Prototype
-
I need to upload any file using
<%=file_field "text"%> -
Then I need to fetch those file name into new textbox below
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
File fields are sandboxed in all modern browsers, so there are lots of things you can’t do, such as setting their value. You can get the value, but you’ll only get the name of the file, not the full path to the file.
Here’s how you can do this with prototype, though.
Here’s the results I get on various browsers on my mac: