COOKIE in handle

See all posts Reply

COOKIE in handle new!
by Hans, 16 years ago
Hello Verot,

I would like to add, implement, a cookie to the file_new_name_body handle, but I don t know how to do it, tried several things all failed.

$handle->file_new_name_body = '".$_COOKIE["xxxxxxxxx"]."3';

Thank you for this fantastic class.
HansReply
Re: COOKIE in handle new!
by colin, 16 years ago
What fails exactly?

Could you copy here the log from the class?
echo $handle->log;
Reply
Re: COOKIE in handle new!
by Hans, 16 years ago
Hello Colin,

as you can see in the log the class is doing his job very well, except the $_COOKIE[] isn't executed as I espected in the $handle->file_new_name_body, here should be displayde the value of the COOKIE.

Hans

file uploaded with success
7KB

link to the file just uploaded: _COOKIExxxxxxx1.jpgfile uploaded with success
1.75KB

link to the file just uploaded: _COOKIExxxxxxx1.jpg


source is an uploaded file
- upload OK
- file name OK
- source variables
    file_src_name : cookie copy.jpg
    file_src_name_body : cookie copy
    file_src_name_ext : jpg
    file_src_pathname : /tmp/phpQY2HJK
    file_src_mime : image/pjpeg
    file_src_size : 22457 (max= 20971520)
    file_src_error : 0
process file to ./../../xxxxxxx/images/small/
- file size OK
- file mime OK : image/pjpeg
- new file name body : ".$_COOKIE["xxxxxxx"]."1
- file name safe format
- destination variables
    file_dst_path : ./../../xxxxxxx/images/small/
    file_dst_name_body : _COOKIExxxxxxx1
    file_dst_name_ext : jpg
- image operation, change extension for conversion type
- no auto_rename if same filename exists
- destination file details
    file_dst_name : _COOKIEArtvibrationsusern1.jpg
    file_dst_pathname : ./../../xxxxxxx/images/small/_COOKIExxxxxxxxx1.jpg
- no overwrite checking
- image resizing or conversion wanted
- source image is JPEG
- resizing...
    check x/y sizes
    resized image object created
    image_src_x y : 66 x 70
    image_dst_x y : 169 x 180
- converting..
    JPEG image created
    image objects destroyed
- process OK
process file to ./../../xxxxxxx/images/small2/
- file size OK
- file mime OK : image/pjpeg
- new file name body : ".$_COOKIE["xxxxxxx"]."1
- file name safe format
- destination variables
    file_dst_path : ./../../xxxxxxx/images/small2/
    file_dst_name_body : _COOKIExxxxxxx1
    file_dst_name_ext : jpg
- image operation, change extension for conversion type
- no auto_rename if same filename exists
- destination file details
    file_dst_name : _COOKIEArtvibrationsusern1.jpg
    file_dst_pathname : ./../../xxxxxxxxx/images/small2/_COOKIExxxxxxxxx1.jpg
- no overwrite checking
- image resizing or conversion wanted
- source image is JPEG
- resizing...
    check x/y sizes
    resized image object created
    image_src_x y : 66 x 70
    image_dst_x y : 56 x 60
- converting..
    JPEG image created
    image objects destroyed
- process OK
cleanup
- delete temp file /tmp/phpQY2HJK
Reply
Re: COOKIE in handle new!
by colin, 16 years ago
This has nothing to do with the class. You have a syntax error while setting up your parameters:
$handle->file_new_name_body = '".$_COOKIE["xxxxxxxxx"]."3';

should be:
$handle->file_new_name_body = $_COOKIE["xxxxxxxxx"]."3";
Reply
Re: COOKIE in handle new!
by Hans, 16 years ago
Colin thanks for your answer.
HansReply