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
https://forums.phpfreaks.com/topic/260982-multiple-file-upload-modifications/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.