open files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a web page that list files for the user to open, but some of the file
names have spaces so they look like this (test document.doc) and when the
user tries to open it they get page not found error, but if the document name
is this test_document.doc it opens fine, so how can I allow for the space in
the file name due to the fact we can't change over 2000 documents to include
an underscore in the name.
 
I got it to work, I did a replace like this
string file = filename.Replace("", "%20");

and that fixed it
 
If you will use Urlencode method then you don't have to do this manual
substitutions. That method will take care of this as well as any other
issues with the path.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top