This topic is locked

Add directory to image path

8/25/2012 1:29:34 AM
PHPRunner General questions
L
luke author

In refer to this topic: Add directory to image path i have not solved my problems.
I try with this code:
global $pageObject;

foreach( $pageObject->filesToMove as $key=>$val)

{

if($pageObject->filesToMove[$key]->sourceFilename==$_FILES["valueImage1".postvalue("id")]["tmp_name"])

{

//create directory if don't exist

$dirname= "files/".$values["Plate"];

if (is_dir($dirname)) {

} else {

mkdir("files/".$values["Plate"], 0777);

}

$pageObject->filesToMove[$key]->destFilename =

$values["Plate"]."/".$values["Image1"];

}

$values["Image1"] = $values["Plate"]."/".$values["Image1"];
if($pageObject->filesToMove[$key]->sourceFilename==$_FILES["valueImage2".postvalue("id")]["tmp_name"])

{

//create directory if don't exist

$dirname= "files/".$values["Plate"];

if (is_dir($dirname)) {

} else {

mkdir("files/".$values["Plate"], 0777);

}

$pageObject->filesToMove[$key]->destFilename =

$values["Plate"]."/".$values["Image2"];

}

$values["Image2"] = $values["Plate"]."/".$values["Image2"];

}
I have 2 problems:

  • if i upload both image1 and image 2, the first is not copied to the folder, but the record is registered with the right link, the second is correct.
  • the images that i upload is not viewed as thubnails, but with is real size. For example: if i upload an image with resolution 2560×1600, my web page resize to that.

T
Tayyab Ilyas 8/26/2012

Hope you are not re sizing images with the resize option. I did that and having the same problem.

L
luke author 8/26/2012



Hope you are not re sizing images with the resize option. I did that and having the same problem.


Yes, i resizing images with the resize option. How did you resolve that?

L
luke author 8/29/2012

Anyone can help me?

T
Tayyab Ilyas 8/30/2012

Batter to ask support team i think there must be some bug in the software. Actually disabled resizing the image as it was not very important for my project.



Anyone can help me?