Pure PHP Upload 3 Support Product Page

Solved

Upload 3 Make Unique Not saving in DB

Reported 17 Apr 2013 22:32:39
3
have this problem
17 Apr 2013 22:32:39 Foster Brovan posted:
Pure PHP Upload 3 is not saving the Unique new name it addeds to the uploaded image.
Example
Image name 100.jpg This is what is saved in the DataBase

Upload same Image 100.jpg makes it Unique.

Unique name 100_1.jpg is being made But it is not saved in the DataBase wh

at is saved is Image 100.jpg

How do I get the Unique name in my DataBase table?

I am using DW 5.5 PHP 5.3 on the sever on a PC.
Code
<?php 
//*** Pure PHP File Upload 3.0.1
// Process form ChangeImage
$ppu = new pureFileUpload();
$ppu->timeOut = 600;
$ppu->nameConflict = "uniq";
$ppu->storeType = "file";
$ppu->progressBar = "win_look.htm";
$ppu->progressWidth = 300;
$ppu->progressHeight = 100;
$ppu->path = "../../article_images/imgaes2013";
$ppu->allowedExtensions = "GIF,JPG,JPEG,BMP,PNG"; // ""
$ppu->redirectUrl = "";
$ppu->checkVersion("3.0.1");
$ppu->doUpload();
?>
<?php
// Smart Image Processor PHP 2.1.0
if (isset($_GET['GP_upload'])) {
$sipp2 = new cGraphicMediator("upload", $ppu, "");
$sipp2->setComponent("GD2");
$sipp2->setMatteColor("#FFFFFF");
$sipp2->resizeEx(500, 600, true, false);
$sipp2->overwrite = true;
$sipp2->saveJPEG(80);
$sipp2->process();
}
?>
<?php
// Smart Image Processor PHP 2.1.0
if (isset($_GET['GP_upload'])) {
$sipp1 = new cGraphicMediator("upload", $ppu, "");
$sipp1->setComponent("GD2");
$sipp1->setMatteColor("#FFFFFF");
$sipp1->resizeEx(200, 100, true, false);
$sipp1->overwrite = false;
$sipp1->setMask("##path##thumb_##name##.jpg");
$sipp1->saveJPEG(100);
$sipp1->process();
}
?>

Thank you.
Foster

Promoted Solutions

Replied 18 Apr 2013 07:04:01
Hello Foster,

There is a workaround until a fix is available.
In Bindings Panel you should have a folder named Upload File(fileFieldName)
In that folder there is an entry named fileName.

Bind it somewhere on your page. It will look like that in the code:
<?php echo $ppu->files("fileFieldName")->fileName ?>

then find in your code the place, where your file field is passed to Inser/Update PHP code ( must be something like this:

 GetSQLValueString( $_POST["fileFieldName"], "text"));

)
and make it look like this:
 GetSQLValueString( $ppu->files("fileFieldName")->fileName, "text"));

you get the
$ppu->files("fileFieldName")->fileName

part from the bind and substitute with it the
$_POST["fileFieldName"]
part in the Insert/Update code.

Regards.

Replies

Replied 18 Apr 2013 06:54:06
18 Apr 2013 06:54:06 Vulcho Vulev replied:
Hello Foster.

The development team is notified about the issue and currently is working on solution. You will be notified in the thread when there is fix available.

Regards:Vulcho.
Replied 18 Apr 2013 07:04:01
18 Apr 2013 07:04:01 Miroslav Zografski replied:
Hello Foster,

There is a workaround until a fix is available.
In Bindings Panel you should have a folder named Upload File(fileFieldName)
In that folder there is an entry named fileName.

Bind it somewhere on your page. It will look like that in the code:
<?php echo $ppu->files("fileFieldName")->fileName ?>

then find in your code the place, where your file field is passed to Inser/Update PHP code ( must be something like this:

 GetSQLValueString( $_POST["fileFieldName"], "text"));

)
and make it look like this:
 GetSQLValueString( $ppu->files("fileFieldName")->fileName, "text"));

you get the
$ppu->files("fileFieldName")->fileName

part from the bind and substitute with it the
$_POST["fileFieldName"]
part in the Insert/Update code.

Regards.
Replied 18 Apr 2013 16:56:05
18 Apr 2013 16:56:05 Foster Brovan replied:
THANK YOU
That worked Great!

Foster
Replied 25 Jul 2013 04:49:22
25 Jul 2013 04:49:22 junaidi wahadi replied:
thank you

Reply to this topic