SunQuest
           FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old August 11th, 2003, 05:58 AM
s_schimmel s_schimmel is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: The Netherlands
Posts: 19 s_schimmel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 43 sec
Reputation Power: 0
Send a message via ICQ to s_schimmel
resize image and upload to ftp problem

I'm making a gallery and now I am having a problem with uploading the thumbnail that I create. The normal file uploads fine to my ftp server but the thumbnail doesn't and I'm not getting any error's either.

This is the part of the script for uploading the thumbnail:
PHP Code:
 $sourceimg ImageCreateFromJPEG($tempnaambestand[$nr]);
    
$thumbimg ImageCreate($thumb_width$thumb_height);
    
ImageCopyResampled($thumbimg$sourceimg0000$thumb_width$thumb_height$dimensions[0], $dimensions[1]);
    
ob_start();
    
ImageJPEG($thumbimg'' 85);
    
$thumbnailbestand ob_get_contents(); 
    

    
ftp_chdir($conn_id"thumbnails");
    
ftp_put($conn_id$naambestand$thumbnailbestandFTP_BINARY); 
    
ob_end_clean();
    
ImageDestroy($thumbimg); 


I think the file is stuck in the buffer but I'm not sure and I don't know how to get it out.

Who has the answer?

Reply With Quote
  #2  
Old August 11th, 2003, 08:49 AM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
Since the ImageJPEG function outputs raw binary data, this is being capture by the ob_get_contents() function. However, you need to write this into a file, as the argument to ftp_put() is a filename. I suggest you write the binary data out to a file in /tmp and then upload it using ftp_put().
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > resize image and upload to ftp problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway