doing scp from java when file has spaces in it

Vinit Khandelwal vinit.k at sonata-software.com
Fri Sep 5 15:41:31 EST 2003


Hi,

I am new to scp. I am trying to scp a file from local (m/c) to remote
through a java application running in Tomcat.

When I try to upload a file with no spaces in it, it works. But if spaces
are present (file name is : "Lots of spaces text .txt") it is not working.

Some of the things I tried are mentioned below and they failed. 

scp  [...options]  '/vhosts/dw02411/tmp_daemon/1020046111/Lots of spaces
text .txt' grt0002d at loninwebp7.uk.db.com:uploads 

scp  [...options]  /vhosts/dw02411/tmp_daemon/1020046111/Lots\\ of\\
spaces\\ text\\ .txt grt0002d at loninwebp7.uk.db.com:uploads 

scp  [...options]  /vhosts/dw02411/tmp_daemon/1020046111/Lots\ of\ spaces\
text\ .txt grt0002d at loninwebp7.uk.db.com:uploads 

scp  [...options]  /vhosts/dw02411/tmp_daemon/1020046111/"Lots of spaces
text .txt" grt0002d at loninwebp7.uk.db.com:uploads 

scp  [...options]  /vhosts/dw02411/tmp_daemon/1020046111//"Lots of spaces
text .txt/" grt0002d at loninwebp7.uk.db.com:uploads 

Is there any other way of running the command for scp from java application?

Thanks in advance.

Vinit
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************




More information about the openssh-unix-dev mailing list