Jump to content

multiple file upload - modifications


jarv

Recommended Posts

  • hi, I am about to use the multiple file upload:
http://phpfileuploader.com/ There are a few issues I need to overcome...
 
  1. I need to be able to resize to thumbs in a seperate folder called thumbs at 100px height
  2. I'd like to rename my files with random numbers so I can upload same file name and it won't overwite?!
  3. also, I'd like to INSERT EACH image I upload into a database

 

in my original code (single upload) I have resize to thumbs and insert in database:

 

resize("gallery/".$FileName, 100, "thumbs/".$FileName);
      
      // Define $myusername and $mypassword
$UserID=$_POST['UserID'];
$PictureName=$_POST['PictureName'];
$PictureDate=$_POST['PictureDate'];
$TargetID=$_POST['TargetID'];

// To protect MySQL injection (more detail about MySQL injection)
$UserID = stripslashes($UserID);
$PictureName = stripslashes($PictureName);
$PictureDate = stripslashes($PictureDate);
$TargetID = stripslashes($TargetID);
$UserID = mysql_real_escape_string($UserID);
$PictureName = mysql_real_escape_string($PictureName);
$PictureDate = mysql_real_escape_string($PictureDate);
$TargetID = mysql_real_escape_string($TargetID);

      
      $sql = "INSERT INTO rstargetpictures (UserID, FileName, PictureName, PictureDate, TargetID)
VALUES ('$UserID', '$FileName', '$PictureName', '$PictureDate', '$TargetID')";
$msg = "New booking added";
$result = mysql_query($sql) or die('Error: ' . mysql_error() . '<br>SQL: ' . $sql);

 

 

the code for the multiple uploader is too long, it's in OOPHP too!

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.