1
我使用这个插件不需要的字符串:http://hayageek.com/docs/jquery-upload-file.php错误,附加到文件(WebKitFormBoundary)
,我用它来发送文件给一个WCF REST服务,并保存其硬盘上。
上传工作正常,但问题是,图像,EXE等上传破碎。 如果我打开上传的文件用文本编辑器,我可以看到不必要的字符串
在开始:
------ WebKitFormBoundaryPUTfurckDMbpBxiw内容处置:表格数据; NAME = “文件”;文件名= “image.png” 内容类型:image/PNG
在端:
------ WebKitFormBoundaryPUTfurckDMbpBxiw--
我的服务代码:
<OperationContract()>
<WebInvoke(ResponseFormat:=WebMessageFormat.Json, Method:="POST", UriTemplate:="GetFile?fileName={fileName}&accion={accion}")>
Function GetFile(str As Stream, fileName As String, accion As String) As String
Try
Dim absFileName As String = "C:\inetpub\wwwroot\UploadedComponents\" & fileName
Using fs As New FileStream(absFileName, FileMode.Create)
str.CopyTo(fs)
str.Close()
End Using
Return "Upload OK"
Catch ex As Exception
Throw ex
End Try
End Function
任何想法解决这个问题?