Jump to content

jayesch

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jayesch's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It fails still. My code initially had complete path in the ftp_put(). So to narrow down the problem I did a ftp_chdir() as an additional step. Also I have made doubly sure that I do have write permissions to the destination directory. HOST:/Library/WebServer/Documents/MobileMedia/site/uploads/video USER$ ls -l total 0 drwxrwxrwx + 6 USER admin 204 Sep 21 22:49 mpeg
  2. Hello, I see this weird problem with ftp_put. I have checked for all common sources of errors and find that none of them apply for my case. 1) I can do ftp_chdir() to destination directory with success 2) I have write access the the destination directory. 3) I can upload files to FTP server from windows command prompt or other FTP clients. 4) File source path has no spaces in it(C:\test.txt) Unfortunately I do not have access to FTP server logs. FTP server is hosted on a MAC machine with OS-X 10.0 Here is the code snippet = 1. 2. $ftp_user_name='user'; 3. $ftp_user_pass='password'; 4. $ftp_server='somehost'; 5. $destination_file='test.txt'; 6. $src_file='c:\test.txt'; 7. 8. $conn_id = ftp_connect($ftp_server); 9. $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); 10. if(!ftp_chdir($conn_id,'/Documents/MobileMedia/site/uploads/video/mpeg')) 11. { 12. echo "No read permission in the destination directory </br>"; 13. } 14. if(!ftp_put($conn_id, $destination_file, $src_file, FTP_BINARY)) 15. { 16. echo "Upload operation to FTP server failed </br>"; 17. } 18. ftp_close($conn_id); 19. Let me know if there is anything wrong or there exists any other source of error. Thanks Jayesh Sharma
  3. [!--quoteo(post=361396:date=Apr 3 2006, 06:36 PM:name=earl_dc10)--][div class=\'quotetop\']QUOTE(earl_dc10 @ Apr 3 2006, 06:36 PM) [snapback]361396[/snapback][/div][div class=\'quotemain\'][!--quotec--] remove your <html> <head> and <body> tags, only have your php script in the web page, trust me I had the same problem and this cleared it up [/quote] Thank you so much for your help. This is the wierd problem that no one mentions in the text books or online tutorials. While rest of your code works with HTML tags, this doesnt. Jayesh
  4. I know I sound very stupid for writing this post. I have read probably 100 documents by this time. I am working on an assignment in my class for which I need to to poll a SNMP based device and show the input output traffic statistics in form a GIF image. I have never worked on PHP before. Although the portion of the script which collects the statistics from SNMP device is working correctly, the other part which deals with image creation doesnt work. So I tried to write a very basic program to create a GIF image. <html> <head> <title> PHP TEST </title> </head> <body> <?php header("Content-type: image/gif"); $im = imagecreate(600,115); $backgroundColor = imagecolorallocate($im,204,204,153); imagefill($im,0,0,$backgroundColor); imagegif($im); ?> </body> </html> The problem is that it gives me warning :- ""Warning: Cannot modify header information - headers already sent by (output started at /home/compsci/jsharma/public_html/program3.php:6) in /home/compsci/jsharma/public_html/program3.php on line 8" I know this problem is created because of white space character. But despite my sincere efforts I have not been able to locate any white spaces before or after <?php and ?> tags. Also instead of a GIF image I see some junk characters in the browser. If i remove line containing header(); then the warning goes off but I still see junk characters in the browser and no image. Please tell me if I am missing on something. Thanks in advance Jayesh
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.