QuizToon Posted September 19, 2009 Share Posted September 19, 2009 Hi all, I am having a exremely frustrating time. Usually I can ask a couple of questions of the expers in this forum and get the code sorted. I have been trying to do this one for myself and have come to the conclusion that I am thick. I just cannot get my head around this at all. I cannot fathom how it works. Basic background - I have a MySql database, in it I want to store id, title, bodytext, imagepath, imagename, uploaddate,image size, and image caption. I have a script already which is working without problems. Up until recently this was fine, however, I now need to resize the image to a size which is easily manageable on the web, whilst keeping the aspect ration. Image size of 800x600 would be fine. The images being uploaded are generally from a digital camera and the sizes are something like 3000x2000. Now I did manage to get a script to work and do all this, but with one problem. If the filename ends with uppercase .JPG then the scripts executes and does everything apart from upload the actual image. Dont know how to fix this and am now ready to throttle the kids, kill the budgie and kick the dog only joking but I think you get level of my frustration. The script for the upload and resize are 3rd party scripts, which I have tried to integrate with my upload script. I have attached the files if someone would like to see them. Many thanks for looking [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/174800-file-upload-and-resize/ Share on other sites More sharing options...
.josh Posted September 19, 2009 Share Posted September 19, 2009 Word of advice, you're more likely to get someone's help if you post the relevant part of your script (in code tags) instead of making people download some zip. The relevant part of your script would be the part that happens after you submit the form (where the form action points to). Offhand, without looking at your file or seeing what it's doing or using, I'd say the easiest thing for you to do is $_FILES['userfile']['name'] = strtolower($_FILES['userfile']['name']); $_FILES['userfile']['tmp_name'] = strtolower($_FILES['userfile']['tmp_name']); $_FILES['userfile']['type'] = strtolower($_FILES['userfile']['type']); at the top of the script the action="..." points to. You probably only need one of those, and you probably can just strtolower some other var grabbing it already, but again, I'm not going to download and sift through some script. Quote Link to comment https://forums.phpfreaks.com/topic/174800-file-upload-and-resize/#findComment-921217 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.