Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Auto copy file field to text/hidden feild?

Participant ,
Aug 21, 2009 Aug 21, 2009

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!

TOPICS
Server side applications
676
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2009 Aug 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 21, 2009 Aug 21, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines