PHP Classes

upload class problem

Recommend this page to a friend!

      Easy PHP Upload  >  All threads  >  upload class problem  >  (Un) Subscribe thread alerts  
Subject:upload class problem
Summary:file only uploadinginthumbs directory
Messages:3
Author:ashokvas
Date:2005-01-07 12:27:52
Update:2005-01-08 04:46:47
 

  1. upload class problem   Reply   Report abuse  
Picture of ashokvas ashokvas - 2005-01-07 12:27:52
I am trying to use this class with the Photo_upload form given in the class.

I find that the file is only getting uploaded to the thumbs directory(nothing goes to the foto directory).

In the photo-upload form,
the function process_image() has beenshown as

"function process_image() {
$filename = $this->upload_dir.$this->file_copy;
$thumb = $this->thumb_folder.$this->file_copy;
$foto = $this->foto_folder.$this->file_copy;
$this->get_img_size($filename);
if ($this->y_size > $this->x_size) {
$this->img_rotate($filename);
$this->get_img_size($filename); // repeat this because the img is changed
}
if ($this->x_size > 640) {
$this->thumbs($filename, $foto, 640, 80);
}
$this->thumbs($filename, $thumb, 240, 85);
$this->del_temp_file($filename);"


Can you please tell me what has to be repeated?

"repeat this because the img is changed" shownin the code above.

I just want to upload images,convert into thumbnails,preview size(slightly bigger than thumbnails) and store them in 3 directories-full size images,thumbnails and preview size.
All the files should be stored with same name but in different directories(the name of any file will be same,whether it is in the full size directory or the thumbnail directory or preview directory)


Thanks in advance.

Thanks

Ashokvas

  2. Re: upload class problem   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-01-07 20:01:09 - In reply to message 1 from ashokvas
I suggest to controle the image size again because it is changed since the last image resize.

If you need a more professional solution for resizing images than use a different class, here on phpclasses are a lot of them. This class is created for uploading files. The image extension is just an example about what you can do with this class.

  3. Re: upload class problem   Reply   Report abuse  
Picture of ashokvas ashokvas - 2005-01-08 04:46:47 - In reply to message 2 from Olaf Lederer
You have shown a demo of the upload class on the PHP classes site.
There you have shown a form to upload and download files.
Can I get the script for handling the upload/download so I can understand better?

Ashokvas