私はuploadifyを機能させようとしています。何かをアップロードしようとすると、ブラウズ機能は正常に動作しますが、短い一時停止があり、「http エラー」または「IO エラー」が発生します。
進行状況バーが表示されないため、パスの問題であると思われましたが、swf ファイルは画像/スクリプトと同じ場所にあり、問題ないようです。
誰でもこれを経験したことがありますか?
.ashx
ファイルの受信に汎用ハンドラ ( ) を使用しましたか? これが私のコードです
Public Class Video_File_Upload
Implements System.Web.IHttpHandler
'Dim File_Path_Chapter_Video As String = "XXX/"
Dim Directory_Videos As String = System.Configuration.ConfigurationManager.AppSettings("Videos_Save")
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = "text/plain"
context.Response.Expires = -1
Try
Dim postedFile As HttpPostedFile = context.Request.Files("Filedata")
Dim filename As String = postedFile.FileName
'string folderName = context.Request.QueryString["FolderName"];
Dim NOF As String
Dim CheckFilePath As String
Dim MapPath As String
NOF = Convert.ToString(context.Request("NOF"))
CheckFilePath = Directory_Videos & NOF
If Directory.Exists(CheckFilePath) = False Then
Directory.CreateDirectory(CheckFilePath)
End If
MapPath = Directory_Videos & NOF & "/" & filename
postedFile.SaveAs(MapPath)
Catch
End Try
End Sub
ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
次に、この行をアップロード設定に入れる必要があります: "uploadScript:Video_File_Upload.ashx"