Rommeo Posted February 16, 2010 Share Posted February 16, 2010 I have a simple form to send the photo file to "upload.php" <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="uploaded_image" /> <input type="submit" name="submit" value="Upload" /> </form> And I have a upload.php file include "uploadclass.php"; $image = new image(); $image->url = $_FILES['uploaded_image']['tmp_name']; $image->upload(); and my image class : class image { public $url; public $directory ="photos"; public function __set($name,$value) { $this->$name = $value; } public function upload() { $file_ext = strrchr($this->url, '.'); // For Instance, .jpg, .gif or .php $copy = copy($this->url, "$this->directory" . $this->url); // this line has problem I think } } the last line was working like this : $copy = copy($_FILES['imagefile']['tmp_name'], "$directory" . $_FILES['imagefile']['name']); But since I m passing it like a variable, I dont know how can I deal with the option "tmp_name" and "name". So this script does not work, how can I send all the variables that the file have ? Thank you in advance. Link to comment https://forums.phpfreaks.com/topic/192280-upload-photo-class-problem-can-not-send-data/ Share on other sites More sharing options...
Rommeo Posted February 16, 2010 Author Share Posted February 16, 2010 any ideas ? Link to comment https://forums.phpfreaks.com/topic/192280-upload-photo-class-problem-can-not-send-data/#findComment-1013369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.