Can someone help me write a php script?

Posted by Glen on July 30, 2010, 10:17 p.m.

I'd like to make a script that allows me to upload a single image to my website and makes three copies of that image, resizes them, and places them in their proper directories.

For example: Image 1

1a.jpg 1280x800

1b.jpg 600x375

1c.jpg 200x125

Each would go into a different folder according to their letter. I need a simple upload form that allows me to choose the image from my computer, and have it resize, copy, and place them in the folders. It wont be a public form. It's just to make my life easier as I have several hundred images to upload. XD. Can anyone help? I'd appreciate it.

Comments

Juju 14 years, 3 months ago

Why write a program to do that server-side?

Write a form that allows you to upload to a directory then write a client-side application to do it for you.

a2h 14 years, 3 months ago
Glen 14 years, 3 months ago

I managed to make the script but im having one little problem.

I need to add the letter "A" to the end of the file's name. How do I do that when this is the naming code:

$filename = "uploaded/images/". $_FILES['file']['name'];

I tried using:

$filename = "uploaded/images/". $_FILES['file']['name']."A";

$filename1 = "uploaded/images/". $_FILES['file']['name']."B";

$filename2 = "uploaded/images/". $_FILES['file']['name']."C";

But that just adds it to the end of the extension. I don't want it on the extension. I want it added to the file name before the extension. XD

Glen 14 years, 3 months ago

nvm, i got it.