images and mysql<

liunx

Guest
Hi all,

I have a file upload for images. When I upload the images I append the image_id to the file name. MySQL saves the original file name. When I load the images on a web page I would like to have them display with their original names. I know how to do this with headers for Download ing files, but I'm not sure how to do it as an image on a page. Any ideas?

Thanks :Dwhy change the name? if you do then save the origanl namein mysql as well. and save the iamge as the orignal name.

but it sounds like you are adding the image_id to it in the db andthen not addding it to the original one. if you are then why? it fyou are not then you can't show the image unless you keep the name as it is and not append to it. if you append to it then take extract the image_id off it and then try to show it it will be a broken image as there are no images of that name.I use image_id so the images can not overwrite each other. I have a Download script I wrote with help from a book with headers that lets you have the images all named by sql id's and then you can Download them by their original names through the header which changes the name. I was hoping there was a way to do this on a page also some how. The mysql table has image_id and image_name which is the original name. Right now I am just linking the id/name.I don't see how. the name as to be the same as the name in the folder in order to show them. you have to load them first, but if you want it so they can save them as teh origanl then yeah, you can do that. just get the real name from the db and stick it into the header, in teh attachemn part. but it depends on how you are showing it?I am just displaying them on a web page, I guess I can leave the id in, no biggie. I was just curious if there was a way. Could you not copy them to a temp dir as they loaded? I wouldn't want to do anything too elaborate anyway or anything that might cause strain on the server. I think I'll just leave them as you said. :D
 
Back
Top