七牛文件上传失败!报错:Path cannot be the empty string or all whitespace.

错误信息

错误位置

上传其他图片是成功的,我用QQ截图保存png格式上传也是失败,保存jpg格式能成功!
上一图是错误信息,下图是抛出错误的地方。也不知道是什么原因?

Exception Date:2017/9/8 13:02:41
Exception Type:System.ArgumentException
Exception Message:Path cannot be the empty string or all whitespace.
Exception Source:mscorlib
Exception StackTrace: at System.IO.Directory.CreateDirectory(String path)
at Qiniu.Storage.Persistent.ResumeRecorder.createDirIfNotExist()
at Qiniu.Storage.Persistent.ResumeRecorder..ctor(String dir)
at Qiniu.Storage.UploadManager.uploadStream(Stream stream, String key, String token, UploadOptions uploadOptions, UpCompletionHandler upCompletionHandler)
at EastWestWalk.UpLoadWeb.Controllers.FileUploadController.UploadMain(Stream stream, String fileType, CommonData data)
at EastWestWalk.UpLoadWeb.Controllers.FileUploadController.UpLoading(String type, String bucket, String returnUrl, String size)

阅读 4.3k
1 个回答

您好,根据报错信息,应该是向上传方法传入了空的 filepath 导致的。您可以把 path 打下 log 确认下,是否为空。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进