c# - Cannot open document from database -
i'm saving document have spaces in filename, url in database is:
http://wingtipserver/lists/knowit.cv-employeedocumentslistinstance/attachments/2/my example pdf file.pdf
but when want open in imagebutton, using imagebutton.postbackurl
wont open because filepath is:
http://wingtipserver/lists/knowit.cv-employeedocumentslistinstance/attachments/2/my%20example%20pdf%20file.pdf
how remove spaces? or should validation on fileupload can't upload documents spaces?
the encoded spaces equate directly spaces, if looking directly @ file system.
yes, should normalise file names, makes sense not have spaces, in opinion, replace hyphens or other 'canonical' character. but, other that, happens when hit url? 404? 500? if told experiencing may suppose appropriate fix, stands, think problem shouldn't problem.
to correct myself bit here, when looking file in database naturally strings won't match. in order overcome this, should decode path in url before look-up, using server.urldecode(urlpart);
Comments
Post a Comment