| Author |
553 Can't open that file: No such file or directory
|
emilio rossi
Ranch Hand
Joined: Jul 01, 2011
Posts: 47
|
|
hello everyone, im new at the forum and a newbye in java,
not sure if this is the right section to post this...anyway...
im trying to upload files to my site via java using Apache common net 3.0.1 api
but cannot store file in my public directory cause i obtain "553 Can't open that file: No such file or directory"
permissions are write, read and execute, and in fact im able to delete via java from public directory all the files i want to,
but cannot store new ones
here's the code:
here's the output :
LOG true
230 OK. Current restricted directory is /
----- list of file i have in my public directory------
FILE true
STORED false
553 Can't open that file: No such file or directory
took a look on the net but didnt found any help
can someone more skilled than me tell me where am i wrong??
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
First of all welcome to the JavaRanch!
I have some remarks about your code:
Variables should start with a lowercase letter.
The variable port is declared as a String however later in the code it is parsed to an int. Why not declare it as an int?
The String variables are declared within brackets. This is unnecessary and I would remove them.
You should declare and initialize variables just before you need them. The variable fis is declared 13 lines before it is used.
Closing fis & disconnecting with the client should happen in a finally block. Otherwise in case an exception occurs the resources will not be closed.
Just a guess for fixing your problem: shouldn't this:
be:
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
emilio rossi
Ranch Hand
Joined: Jul 01, 2011
Posts: 47
|
|
hey, thanks for the answer and the useful tips
i was sure it was one of my stupid fault somewhere
thanks again
|
 |
 |
|
|
subject: 553 Can't open that file: No such file or directory
|
|
|