Jump to content

file upload and resize


QuizToon

Recommended Posts

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.