开发者

How to disable the folder navigation in FileUpload control

开发者 https://www.devze.com 2022-12-13 16:33 出处:网络
How to disable the folder navigation in the browse file popup window that appears when browse button is clicked in FileUpload control.

How to disable the folder navigation in the browse file popup window that appears when browse button is clicked in FileUpload control.

Currently, the browse file popup window shows specific folder which contain subfolders and files; I want to limit the user; user should not be able to browse/navigate through the upper level fol开发者_如何学Pythonders.


The asp.net server control is really just a wrapped html input type=file . The problem you're experiencing isn't limited to ASP.net and unfortunately, there's no way to affect the browser's behavior on that from your app.


You can't do this with an input type=file but you may be able to if you can use a flash-based file upload control instead.


The standard controls don't allow much flexibility. Possibly a more specialized component can help...

You'd likely have to download a component or plugin to the user's browser that the user allows to install so you can access their local file system and custom traverse it. This used to be done with IE/ActiveX in the Windows world, but there were/are a lot of security issues with it and it's platform restrictive.

A .NET-based component is Silverlight File Uploader.

I think Telerik's File Upload control is somewhat flexible, and there are many similar 3rd-party components out there.

Possibly use Flash like Gmail's email attachment upload component, concept shown this ASP.NET sample on CodeProject.

Also you might consider a Java applet on the client like facebook's Image Uploader; for a similar developer component you might start looking into something like Java Uploader,

All these client solutions are open or make source code available to help with ideas, except Telerik. All solutions are ubiquitous enough to support multiple browsers. Each component allows traversal of the local hard drives using a different UI/technology. I assume custom traversal or configuration is afforded by each to a degree.

Expect the component to be secure first and secondly flexible for the programmer.

0

精彩评论

暂无评论...
验证码 换一张
取 消