Forum Moderators: mack

Message Too Old, No Replies

Upload Picture to Dir and Filename to Database

         

moverbay

3:54 pm on Apr 14, 2005 (gmt 0)

10+ Year Member



This is probably an easy question for most of you, as I am new to web based programming. I have developed a website for my son's REC Baseball League that is database driven. I'm using MYSQL and the pages are devleoped in ASP. I have an admin section where I can enter Coaches into a table, Players into a Table, Practice Schedules etc... I want to add to this form a field where I can upload a picture and store it in a directory (images/Photos) and have the filename stored in a database field (TeamPic). So that when someone goes to the specified Team Page the filename will be associated with the TeamID number and I can display it on the page with the other Team information that is already displayed. Any suggestions? I've been through 3 different books (about 2 weeks worth of reading and looking on the web) and I haven't come up with an answer as of yet? Also if you know of a way to upload 2 or 3 images in the same manner. Any help is greatly appreciated.

irunsoft

1:04 am on Apr 15, 2005 (gmt 0)

10+ Year Member



Hi first, you have to know how to use the upload form.

<form name="formname" method="post" enctype="multipart/form-data" action="upload.asp">

<input type="file" name="filetoupload"><input type="submit">
</form>

In you are using ASP you have to get an upload object that will let you get the content of you input file type and copy it to the server.