I would recommend using an Ftplet to trap the "STOR", "STOU" and "APPE"
commands and from the beforeCommand method, check the data type in use using
the FtpSession.getDataType() and reject the STOR request if it is not
binary. You can send a reply back to client with waht ever message you want
to say. The client then would definitely know what he is doing wrong and
will try the upload again with the proper data type.

If you do not like this solution, it is open source, so you can tap into the
code change it however you like :)

Regards,

Sai Pullabhotla
Phone: (402) 408-5753
Fax: (402) 408-6861
www.jMethods.com



On Fri, Nov 14, 2008 at 8:36 AM, Johannes Katelaan <[EMAIL PROTECTED]>wrote:

> Yes in fact this is what I want. It's quite OK, that it is non-standard.
> For my application it's essential that the uploaded files are not modified
> in any way. In other words: CR-LF-conversion must NOT take place. So just in
> case the client user forgets to switch to BINARY I want to make this the
> default. If the client user then actively switches from BINARY to ASCII,
> it's definitely his fault.
>
> Johannes
>
> Am 14.11.2008 um 14:42 schrieb Sai Pullabhotla:
>
>
>  The FTP standards mandate that the server should use ASCII mode by
>> default.
>> However, the FTP clients can choose the data type that is appropriate for
>> the file that they are downloading or uploading.
>>
>> So, I'm not sure if you really want to change the default type of your
>> server to Binary and make it a non-standard FTP server.
>>
>> Sai Pullabhotla
>> Phone: (402) 408-5753
>> Fax: (402) 408-6861
>> www.jMethods.com
>>
>>
>>
>> On Fri, Nov 14, 2008 at 7:14 AM, Johannes Katelaan <[EMAIL PROTECTED]
>> >wrote:
>>
>>  Hi,
>>>
>>> when using the embedded ftpserver, is there a simple way to change the
>>> default data type from ASCII to BINARY?
>>>
>>> Regards
>>>
>>> Johannes
>>>
>>>
>

Reply via email to