如何更改文件​​夹上传动态地 [英] How to change upload folder dynamicly

查看:161
本文介绍了如何更改文件​​夹上传动态地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用后送文件上传控制器我CustomerPortal建立与MVC4。
内CustomerPortal可以添加SupportCalls。内支援呼叫您可以附加文件。每一个的SupportCall都有自己的GUID。

I'm using Backload file upload controller in my CustomerPortal build with MVC4. Within the CustomerPortal you can add SupportCalls. Within the SupportCall you can attach files. Every SupportCall has its own Guid.

该web.backload.default.config文件包含文件〜/ Files下的默认上传位置。
不过,我要的文件位置是为每一个不同的SupportCall。爱:〜/文件/ d764578d-2f13-4820-bf1f-3d4427aedf22里的GUID不同,每次

The web.backload.default.config file contains the default upload location of the file "~/Files". However I want the file location to be different for every SupportCall. Like: "~/Files/d764578d-2f13-4820-bf1f-3d4427aedf22" where the Guid differs every time.

我怎样才能做到这一点?

How can I achieve that?

推荐答案

我找到了答案,我的问题在这里:的 https://github.com/blackcity/Backload/wiki/Example-06

I found the answer to my question here : https://github.com/blackcity/Backload/wiki/Example-06

<form id="fileupload" 
      action="/Backload/UploadHandler" 
      method="POST" 
      enctype="multipart/form-data">

    <input type="hidden" 
           name="objectContext" 
           value="@Html.ViewBag.Id" />
</form>`

只是必须添加一个隐藏字段具有ID

Just had to add a hidden field with the Id

这篇关于如何更改文件​​夹上传动态地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆