Dear,
   If u want to access the file control in codebehind make that control "SERVER 
Control"  by right clicking the over the control and by choosing  set as SERVER 
Control. By making file control as server control u dirctly access file control 
say (file1) in codebehind.
 
For uploading of file u have to use following statement:
 
file1.postedFile.save(serverpathwithfilename)
 
If u found any error kindly let me know.
 
Krishan Kant
 


[EMAIL PROTECTED]> wrote:
hi..Im trying to upload images more than one up to users choice..when user 
wants to add a picture,he clicks to a button,and I create a file field with 
javascript dynamically..than he posts the form..how can I save the files to 
server??because these file fields dont have runat=server tags..so I cant 
reach them from code behind..I tried something like that but didnt work:
Private filebir As System.Web.UI.HtmlControls.HtmlInputFile
Private Sub SavePic()
    If Request.Form.GetKey(i).ToString().indexof("file") >= 0 Then
        filebir = CType(Page.FindControl(Request.Form.GetKey(i).ToString()), 
HtmlInputFile)
        filebir.postedfile.saveas(server.mappath("pictures") & "/" & 
path.getfilename(filebir.postedfile.filename)) ''''raises error
    End If
End Sub
when code goes in if clause,it raises error cause filebir is nothing..please 
help..thanks..




---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "AspNetAnyQuestionIsOk" on the web.
  
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


---------------------------------



Send instant messages to your online friends http://uk.messenger.yahoo.com 

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to