ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-gtk-general
php-gtk-general
[PHP-GTK] FTP
by Webmaster Phelios.org other posts by this author
Aug 31 2006 3:50PM messages near this date
[PHP-GTK] FTP | [PHP-GTK] FTP
Hello Steph

<?php
    if (!class_exists('gtk')) {
        die('Please load the php-gtk2 module in your php.ini' . "\r\n");
    }
    function watch_foo($fp, $condition) {
        echo ftell($fp);
        //update progess bar
    }

$file = "Firefox.rar";
$fp = fopen($file, "r");

$conn_id = ftp_connect($server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

[ gtk::io_add_watch($fp, Gtk::IO_IN | Gtk::IO_ERR, 'watch_foo'); ]

ftp_fput($conn_id, $file, $fp, FTP_ASCII);

[ gtk::io_add_watch($fp, Gtk::IO_IN | Gtk::IO_ERR, 'watch_foo'); ]

gtk::main();
fclose($fp);
?> 

Between the brackets are possible locations of io_addwatch but when I 
run it PHP issues this:

PHP Warning:  ftp_fput(): Firefox.rar: Permission denied in 
C:\PHP\ftp.phpw on l
ine 25

Warning: ftp_fput(): Firefox.rar: Permission denied in C:\PHP\ftp.phpw 
on line 2
5
0 -->  this zero I believe that PHP has called the watch_foo

Tricky stuff isn't it? Going to resume this tomorrow 8-)
Happy php coding :-D
Pedro

-- 
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Webmaster Phelios.org
Webmaster Phelios.org
Webmaster Phelios.org
Webmaster Phelios.org
Steph Fox
Steph Fox

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved