Skip to main content
Inspiring
August 21, 2009
Question

Auto copy file field to text/hidden feild?

  • August 21, 2009
  • 1 reply
  • 711 views

Hi,

I am using PHP

I have an upload form on my site. I want to be able to record the file names of the files uploaded in a database by copying the text/info in the file field to a text field or a hidden field in the form. That way when a file is uploaded if the file goes to the folder and a copy of the name of the file with extension goes into the database. I already know how to perform both tasks with one form. I just need to know how to automatically copy text from the file field to the text/hidden field.

Example:

File Field: bob.jpg

Text Field: bob.jpg

(copies info from file field when their is a value)

Thanks!

This topic has been closed for replies.

1 reply

Participating Frequently
August 21, 2009

I'm not quite following. Why do you need to copy the filename to a hidden field. Isn't  filename of the uploaded file already available to the php script?

cwhazzooAuthor
Inspiring
August 22, 2009

Because for some reason when I just try uploading the text from the file field to the database it wont work, probably because its not a text field. So I need to copy from one to another.