2014-02-28 3 views
0

내 이미지를 업로드 할 수없는 이유는 무엇입니까? 나는이 오류가 누군가의 도움이, 난 정말 폴더의 web.config에서 일주일하시기 바랍니다Ajaxfile 업로드 및 이미지

 If Page.IsPostBack = False Then 
     ' Getting the File Name 
     Dim filename As String = e.FileName 

     ' Setting the path to upload Images 

     AjaxFileUpload1.SaveAs(Server.MapPath("images/") & filename) 

     ' Storing the relative path to store into images 
     Dim Imagepath As String = "~/Seller/images/" & filename 
     Dim conss As New SqlConnection(_start) 
     conss.Open() 


     Dim sql1 As String = "INSERT INTO Image(Image,ItemID) VALUES (@image,@item)" 
     Dim myCommand1 = New SqlCommand(sql1, conss) 

     myCommand1.Parameters.AddWithValue("@image", Imagepath) 
     myCommand1.Parameters.AddWithValue("@item", dbItem.SelectedValue) 
     myCommand1.ExecuteNonQuery() 
     Response.Redirect("ItemView.aspx") 

enter image description here

<div> 
    <asp:Label ID="Label1" runat="server" Text="Select Auction:"></asp:Label> <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:DropDownList ID="dbItem" AutoPostBack="true" DataValueField="ItemID" DataTextField="Name" 
       runat="server" > 

      </asp:DropDownList></ContentTemplate></asp:UpdatePanel> 
<asp:Label runat="server" ID="myThrobber" Style="display: none;"></asp:Label> 
    <asp:AjaxFileUpload ID="AjaxFileUpload1" ThrobberID="myThrobber" MaximumNumberOfFiles="4" AllowedFileTypes="jpg,jpeg" runat="server" /> 
</div> 
+1

수 "오류"라는 단어 이외의 다른 오류에 대한 정보가 더 있습니까? 서버 측 코드에 예외가 있습니까? HTTP 응답의 특정 오류? JavaScript 코드에 오류가 있습니까? 여기에 약간의 디버깅이 필요합니다. – David

+0

AjaxFileUpload에 대해 이야기했지만 코드를 배웠습니다 ... 컨트롤이 필요한 컨트롤에 문제가 있다면! – Liath

+1

나는 코드를 업데이트합니다. @Liath – user3287068

답변

0

때문에 그에 잃었어요하시기 바랍니다 수가 있어요. . . 이 핸들러를 추가, 루트의 web.config에서이 부분

<configuration> 
    <location path="AjaxFileUploadHandler.axd"> 
     <system.web> 
      <authorization> 
      <allow users="*"/> 
      </authorization> 
     </system.web> 
    </location> 

를 추가

<system.web> 
    <httpHandlers> 
     <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/> 
    </httpHandlers> 

개발하는 동안 관리자로 Windows7의 또는 windows8, 실행 비주얼 스튜디오 를 사용하는 경우,