Qt-interest Archive, March 2002
networkprotocol
Message 1 in thread
Hello and thanks for your messages,
I would to do a simple operation :
copy a local file to a server via ftp protocol (i don't want ftpclient)
I read the doc and add this lines
QUrlOperator op(
"ftp://username:password@host.domain.no/home/username" );
op.copy( "/tmp/try.png"; ftp://ftp.trolltech.com/qt/source/, FALSE );
but i doesn't work. The says :"And that's all! Of course an implementation
of the FTP protocol has to be available and registered for doing that ".
but i don't really understand what to do after....(i tried a lot of things)
can someone give me an example ?
thanks a lot
stephane B
Message 2 in thread
What is the "ftp://ftp.trolltech.com/qt/source" doing in there? What file
do you want to copy and to where? If you want to copy /tmp/try.png to
ftp://username:password@host.domain.no/home/username (thus the file would
end up being ftp://username:password@host.domain.no/home/username/try.png)
you should do what you have there, but remove the
ftp://ftp.trolltech.com/qt/source. I believe the second parameter of "copy"
should be the destination *relative to the URL given to the QUrlOperator
constructor*. Thus, if the URL pointed to by op is where you want to put
the file, then the relative path for the destination would just be ".", the
"current" directory. Try this for your second line of code:
op.copy( "/tmp/try.png"; '.', FALSE );
I think this should work. I have a program that does just precisely this at
work, but not in front of me. If you're still having problems by the end of
the weekend, I can check on it at work, but if you play with it a bit you
should be able to work it out.
R/
James
P.S.: If you need to "debug" your program and don't have an ftp server of
your own, remember that on most modern OS's (Win95 OSR2 and above, most X11
configurations, etc.) the "URL" file://dir/anotherdir/file is a way to
reference a file on the local filesystem. In Windows, that would be
something like file://C:/dir/anotherdir/file. You can use these for your
destination URL and when that works reliably, just change the destination to
ftp instead.
----- Original Message -----
From: "stepahne B" <isom@nerim.net>
To: "qt interest" <qt-interest@trolltech.com>
Sent: Saturday, March 09, 2002 5:01 AM
Subject: networkprotocol
> Hello and thanks for your messages,
>
> I would to do a simple operation :
> copy a local file to a server via ftp protocol (i don't want ftpclient)
> I read the doc and add this lines
>
> QUrlOperator op(
> "ftp://username:password@host.domain.no/home/username" );
> op.copy( "/tmp/try.png"; ftp://ftp.trolltech.com/qt/source/,
FALSE );
>
> but i doesn't work. The says :"And that's all! Of course an implementation
> of the FTP protocol has to be available and registered for doing that ".
>
> but i don't really understand what to do after....(i tried a lot of
things)
> can someone give me an example ?
>
>
> thanks a lot
> stephane B
>
> --
> List archive and information: http://qt-interest.trolltech.com