Help with Select Cast (Filename)

Discussion in 'C#' started by danjapro, Feb 24, 2009.

  1. #1
    Here is my select case:

    I am uploading Photos, Music and Video to my little personal site. But for video I create a form as you can see below to uplod just text for video like embed code text or flash text. But it will not allow me to upload. How I fix my Select case (Filename) last selcet case. for video to upload just text.
    'find out file type
    		select case media_type
    		case "Photo"
    			select case right(lcase(FileName), 4)
    			case ".jpg", ".gif", ".bmp", ".png"
    				FilePath = Photo_Path
    			case else
    				msg = right(FileName, 4) & " is not a valid file type."
    			end select				
    		case "Audio"
    
    			select case right(lcase(FileName), 4)
    			case ".wma", ".wmv", ".mp3"
    				FilePath = Audio_Path
    			case else
    				msg = right(FileName, 4) & " is not a valid Audio Recommended file type. Ex.(Mp3, WMV or WMA)"
    			end select
    			
    		case "Video"
    
    		select case (FileName)
    			case ""', "<embed", ""
    				FilePath = Video_Path
    			case else
    				msg = (FileName) & " is not a valid file type."
    			end select
    
    		end select
    Code (markup):
     
    danjapro, Feb 24, 2009 IP
  2. danjapro

    danjapro Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I tirded that it did not work.
    What part of the code do you need to see. It appears simple but it is kicking my butt.

    What I am trying to do is instead of uploading mpg files for video just have a <textarea> where they can just insert the Yourtube code.
    Make sense. IT was coded for file upload with insert.

    I just want it to insert the text like
    <object width="425" height="355">
    <param name="movie" value="http://www.youtube.com/v/YsowqYWs7vU&hl=en"></param>
    <param name="wmode" value="transparent"></param>
    <embed src="http://www.youtube.com/v/YsowqYWs7vU&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed> </object>
     
    danjapro, Feb 24, 2009 IP
  3. alexpr07

    alexpr07 Active Member

    Messages:
    284
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #3
    case ""', "<embed", "" - is this the line that causes problem. I see the quotations are not correct ""' instead of "'"
     
    alexpr07, Feb 26, 2009 IP