• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

553 Can't open that file: No such file or directory

 
Ranch Hand
Posts: 47
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??

 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey, thanks for the answer and the useful tips:)
i was sure it was one of my stupid fault somewhere


thanks again
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic