[thelist] Upload file with hyphen in name

Chris at globet.com Chris at globet.com
Mon Feb 13 09:00:39 CST 2006


Casey

> In asp.net, I'm allowing the user to upload files to their server. 
> Standard.  However, when the file has a hyphen in the name it 
> fails to upload.  Having hyphens in the names of the images 
> is system critical and there is no way we can work around it.

[..]

What exception is being thrown? Instead of:

span1.InnerHtml = "An Error occured."

Try:

span1.InnerHtml = ex.Message

Let us know what the exception is.

HTH!

Chris Marsh
Web Developer
http://www.globet.com/
Tel: +44 20 8246 4804 Ext 828
Fax: +44 20 8246 4808

Any opinions expressed in this email are those of the individual and not
necessarily the Company. This message is intended for the use of the
individual or entity to which it is addressed and may contain
information that is confidential and privileged and exempt from
disclosure under applicable law. If the reader of this message is not
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly prohibited.
If you have received this communication in error, please contact the
sender immediately and delete it from your system.  

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org 
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Casey
> Sent: 13 February 2006 14:18
> To: The List
> Subject: [thelist] Upload file with hyphen in name
> 
> In asp.net, I'm allowing the user to upload files to their server. 
> Standard.  However, when the file has a hyphen in the name it 
> fails to upload.  Having hyphens in the names of the images 
> is system critical and there is no way we can work around it.
> 
> sub btnUpload(Sender as Object, e as EventArgs)  Dim picPath 
> as String = uploadThumb.PostedFile.FileName  Dim picTitle as 
> string = System.IO.Path.GetFileName(picPath)
>  Try
>   
> uploadThumb.PostedFile.SaveAs("E:\web\users\jewelfire.com\imag
> es_products\thumbs\" 
> + picTitle)
>   Span1.InnerHtml = "Upload Sucessfully.<br>File Name: " &  picTitle
>   Span1.visible=true
>  catch Exp as exception
>   span1.InnerHtml = "An Error occured."
>  End Try
> end sub
> 
> Is there a trick to getting this to work with hyphens?
> 
> Casey Crookston
> InternetOpus
> www.internetopus.com
> 320-267-0166
> 
> 
> -- 
> 
> * * Please support the community that supports you.  * * 
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip 
> Harvester and archives of thelist go to: 
> http://lists.evolt.org Workers of the Web, evolt ! 
> 
> 



More information about the thelist mailing list