David Schmitz - 2010-06-02 13:18:46
Hello,
great class, that you wrote.
I am using the script to give users the chance upload some images to my server.
The thing is, that I need all images as jpg and as gif. So I was trying to modify the script, that it automatically uploads the file two times, with different extesions.
Here is, what I changed in upload1.php
my changes are in the first lines of that script:
session_start();
require_once "upload_class.php";
$_SESSION['number'] = $_SESSION['number'] +1;
for ($two = 1; $two<2; $two++)
{
if ($two == 1) {$extension = ".gif";} else {$extension = ".jpg";}
$new_name = $_SESSION['object']."_".$_SESSION['client']."_".$_SESSION['number'].$extension;
$upload_class = new Upload_Files;
$upload_class -> temp_file_name = trim($_FILES['userfile']['tmp_name']);
$upload_class -> file_name = $new_name;//.trim(strtolower($_FILES['userfile']['name']));
So, I am renaming the files and giving them the extension jpg and gif.
The problem is, that the second run of the loop doesn't work.
Could you tell me, how to do it?
Thanks,
David