|
Okay... I got the uploader working. The problem was being caused because I didn't have the directory created where it was trying to copy the tmp_file to.
Now... There is a potential that there will be more than one person using this script at a time. What this script does is create feature sheets for realtors that I work with. So... They will upload pictures of the house that they want this on, then it will save the pictures to a fixed file name (ie. mainpic.jpg, featurepic1.jpg, featurepic2.jpg, etc). Then it takes those set .jpg names and resizes them and saves them to tmp0.jpg, tmp1.jpg, tmp2.jpg, etc.
Then, I use the tmp#.jpg pics to create the feature sheet as they are now the sizes that I need for my template.
Heres my concern. Although unlikely, it will be possible that two realtors do this at the same time thereby possibly getting messed up feature sheets because it might overwrite a pic.
So... I'm thinking... Maybe I should somehow use sessions or something to save a file with a temporary name unique to the session that launched it. Then create the feature sheet from that. The problem is that I don't know how, and I will need to figure out a way to delete the file after 24hrs or something to make sure that my HDD doesn't fill up. Although, I probably could create a cronjob to go in and delete any files that are older than 24hrs or something.
I would also like to make it so that if they typed something wrong on the feature sheet that they don't have to re-upload the pics. Right now the way it is set they do.
Any ideas??
|