• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to view the file through application because of file name with spaces

 
shan blossom
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using file upload in my application.I have uploaded a file in my local folder say in D: whose name contains more than 1 word separated by spaces(Ex.file upload.txt).The file is saved successfully in the physical path.If I am trying to view this file through application ie.by clicking a link or by clicking the button,File not Found Exception is coming.Will anyone please help me solving this issue?
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are you "clicking on a link or by clicking the button"? The application you are using may have some bearing on your question, don't you think?
In general, the space character is interpreted as a command separator. On windows you either need to wrap the path in quotes so the path does not get split or use the corresponding 8.3 file name (i.e. "c:/program files" is usually "c:/progra~1").
On Linux you could escape the space (i.e. "/home/you/file\ upload.txt") but I haven't tried that on windows or other *nix.
 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure, but the following may also work:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!