You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-dev@incubator.apache.org by Stas Ostapenko <st...@gmail.com> on 2006/11/27 14:15:45 UTC
Unable to upload
Hi !
I'm facing problems with file upload under admin account. It is
happens when I'm using FAR ftp client. I can delete a file, can
overwrite, but cannot upload if there is no file with such name.
Output from ethereal :
--------------ethereal------------------
220 Service ready for new user.
USER admin
331 User name okay, need password for admin.
PASS admin
230 User logged in, proceed.
SYST
215 UNIX Type: Apache FTP Server
PWD
257 "/" is current directory.
REST 0
350 Restarting at 0. Send STORE or RETRIEVE to initiate transfer.
PORT 192,168,3,42,8,11
200 Command PORT okay.
LIST -la
150 File status okay; about to open data connection.
226 Closing data connection.
PORT 192,168,3,42,8,12
200 Command PORT okay.
LIST -la /file.txt
150 File status okay; about to open data connection.
501 Syntax error in parameters or arguments.
226 Closing data connection.
SIZE /file.txt
550 /file.txt: No such file or directory.
TYPE I
200 Command TYPE okay.
--------------ethereal------------------
FTP client is FAR manager FTP client. Other servers are working OK.
But when upload file using ftp command all is OK (ethereal output) :
--------------ethereal------------------
220 Service ready for new user.
USER admin
331 User name okay, need password for admin.
PASS admin
230 User logged in, proceed.
PORT 192,168,3,42,8,59
200 Command PORT okay.
LIST
150 File status okay; about to open data connection.
226 Closing data connection.
PORT 192,168,3,42,8,60
200 Command PORT okay.
STOR ftpserver-dev.jar
150 File status okay; about to open data connection.
226 Transfer complete.
QUIT
221 Goodbye.
--------------ethereal------------------
But ! The size of original file is 298,470 bytes, uploaded 300,046
bytes. Configuration of server is default - server started with
ftpd.bat.
Re: Unable to upload
Posted by Niklas Gustavsson <ni...@protocol7.com>.
Niklas Gustavsson wrote:
> Hey Stas
>
> Sorry for the late reply :-/
>
> Stas Ostapenko wrote:
>> LIST -la /file.txt
>>
>> 150 File status okay; about to open data connection.
>>
>> 501 Syntax error in parameters or arguments.
>>
>> 226 Closing data connection.
>
> We do not currently support the "LIST -la" syntax for this command.
> Anyone know where this is specified? The LIST command in RFC 959 is
> specified as:
> LIST [<SP> <pathname>] <CRLF>
Please ignore this crap as we do in fact support this syntax. I'm
currently working my way through our DirectoryLister with adding tests
and I will probably refactor it heavily.
/niklas
Re: Unable to upload
Posted by Niklas Gustavsson <ni...@protocol7.com>.
Hey Stas
Sorry for the late reply :-/
Stas Ostapenko wrote:
> LIST -la /file.txt
>
> 150 File status okay; about to open data connection.
>
> 501 Syntax error in parameters or arguments.
>
> 226 Closing data connection.
We do not currently support the "LIST -la" syntax for this command.
Anyone know where this is specified? The LIST command in RFC 959 is
specified as:
LIST [<SP> <pathname>] <CRLF>
I'm guessing this is just a de facto convention that FTP clients has
started using to figure out a solution to the problem of showing hidden
files.
Also, for servers that allow for the -la option, how would they
recognize that from someone trying to list the file (somewhat oddly)
named "-la foo"?
If we were to implement this support, should we make if configurable and
default to disabled due to the security issue of showing hidden files?
Other servers seem to do this as well.
>
> SIZE /file.txt
>
> 550 /file.txt: No such file or directory.
This makes me more curious. The SIZE command is implemented and I just
added unit tests that does work as expected [1]. Could you please try to
verify this bug with the latest code (from SVN) and if you still get the
error write up an description on how to reproduce it?
[1]
https://svn.apache.org/repos/asf/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/SizeTest.java
/niklas
Re: Unable to upload
Posted by Stas Ostapenko <st...@gmail.com>.
Dave, thanks for reply.
> Your first trace doesn't show a file upload...
>
> > LIST -la /file.txt
> > 150 File status okay; about to open data connection.
> > 501 Syntax error in parameters or arguments.
>
> > SIZE /file.txt
> > 550 /file.txt: No such file or directory.
>
> Both of these are in error because the file doesn't exist. So I'm
> not sure what the issue is that you have.
In fact, file exists. I can't figure out where the problem is. But it
seems to be that it is FAR FTP Plugin bug, since upload works with
other tools. But it is not easy to accept - I had used it for a couple
of years :)
> A difference in size is almost always due to an incorrect data
> transfer mode. If you were in ASCII mode and running the server on
> a Windows machine, then bytes are going to be added. Try
> transferring the file in BINARY mode.
You absolutely right about binary mode, I have missed it, sorry.
Re: Unable to upload
Posted by Dave Roberts <da...@saaconsultants.com>.
It was 27/11/2006 14:15, when Stas Ostapenko wrote:
> I'm facing problems with file upload under admin account. It is
> happens when I'm using FAR ftp client. I can delete a file, can
> overwrite, but cannot upload if there is no file with such name.
Your first trace doesn't show a file upload...
> LIST -la /file.txt
> 150 File status okay; about to open data connection.
> 501 Syntax error in parameters or arguments.
> SIZE /file.txt
> 550 /file.txt: No such file or directory.
Both of these are in error because the file doesn't exist. So I'm
not sure what the issue is that you have.
> STOR ftpserver-dev.jar
> 150 File status okay; about to open data connection.
> 226 Transfer complete.
> But ! The size of original file is 298,470 bytes, uploaded 300,046
> bytes. Configuration of server is default - server started with
> ftpd.bat.
A difference in size is almost always due to an incorrect data
transfer mode. If you were in ASCII mode and running the server on
a Windows machine, then bytes are going to be added. Try
transferring the file in BINARY mode.