• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Uploading a file, moving it, and adding related info

#1
[eluser]aaronr[/eluser]
I am wondering if there is some kind of example code out there showing how to upload a file with a description, title, etc.

I have a form that is storing information in the database, but I need users to be able to attache a file to the entry in the databse. I would like to be able to renamed the filename to the ID of that entry.

Does anyone know of a simple tutorial on how to do that? I see a lot of tutorials show how to upload, but nothing that shows you how to upload and move a file to a filename AND store other information associated with the file.

thanks

#2
[eluser]Jeremy Gimbel - Conflux Group[/eluser]
Have you looked at the File Uploading Class in the user guide?

The code there demonstrates how to do a file upload, and the class allows you to specify a filename instead of the original.

For additional data, you're going to need to store that in the database. Usually, I just store the filename as a key in the record in the database, so I can easily find the data related to a given file or vice versa.

#3
[eluser]mi6crazyheart[/eluser]
@aaronr
Hope , this will help u : http://www.viewsboard.com/index.php/dboa...ead/28/182

#4
[eluser]aaronr[/eluser]
[quote author="mi6crazyheart" date="1281946104"]@aaronr
Hope , this will help u : http://www.viewsboard.com/index.php/dboa...ead/28/182[/quote]

@mi6crazyheart, that is EXACTLY what I was looking for. Thank you very much.

#5
[eluser]aaronr[/eluser]
[quote author="jeremygimbel" date="1281938449"]Have you looked at the File Uploading Class in the user guide?

The code there demonstrates how to do a file upload, and the class allows you to specify a filename instead of the original.

For additional data, you're going to need to store that in the database. Usually, I just store the filename as a key in the record in the database, so I can easily find the data related to a given file or vice versa.[/quote]

Thanks Jeremy, I looked at the File Upload class and it makes sense overall, but I wasn't sure how to combine submitting data to the DB and uploading in the same "page" (or controller).

I think the URL that is mentioned below shows me what I need to do.

thank you for you time


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.