File upload control for asp.net mvc - asp.net-mvc

I'm writing an asp.net mvc application. I'm looking for free control to make file(s) upload. (Multiple files upload is not required). I found uploadify, ajax uploader, c5 filemanager.
I'm looking rather example which I could include in Razor form and add additional fields such as i.e. file description.
Do you have any specific control which you could suggest?

Uploadify in my opinion is the best.
Check out:
How do I get jQuery's Uploadify plugin to work with ASP.NET MVC?
its the same in mvc3.

Related

asp mvc file upload

I have a form in asp.net mvc 3 project with some properties (a name and some extra properties who need to be filled in).
What i also need is a file to upload in the same form.
I placed an input type "file" and that works when i use Request.File the file is ok.
But i'm also using form validation, so when my name is not filled in, it's not possible to save. That works fine, but then my file is cleared..
Someone who has a good example to use file upload in a form? (with other fields and validation)
In addition to #Neil Knight's excellent references in his answer, if you're using ajax (and you probably are or will be to leverage MVC's ability to facilitate partial page refreshes) the jquery plugin here has proved itself useful in enabling file upload without a full page navigation.

ASP.NET MVC's Content/Themes/base Directory

What's the purpose of the Content/Themes/base directory in an ASP.NET MVC application? I see that it has some images (which as far as I can tell, are not used); and a bunch of jQuery CSS files.
What are these files for? Are they used by default in a new ASP.NET MVC application?
jQuery UI is included with new ASP.NET MVC projects; these files are used by all the different widgets. If you're not going to use jQuery UI, or if you want a custom download package (available from their website), you can delete all of these files (and the references to them in the layout/master page file).

file upload using ajax in asp.net mvc

file upload using ajax by retaining all the other information in the page.
I've used the ajaxForm plug-in for this, works pretty good (and is a pure JavaScript/jQuery solution).
asp.net mvc file upload ajax post
How can I upload a file via ASP.NET MVC and show a progress bar?
http://www.uploadify.com/
hope this helps

CKEditor Image Upload

I am looking to include CKEditor in a project I am working on and I need the image upload support provided by the CKFinder plugin, however I do not particularly need the rest of the CKFinder tool and thus purchasing a license is a little overkill. Has anyone taken the time to implement a custom image uploader for CKEditor 3 that will work with ASP.NET MVC? If need be I can create my own, just wanted to check here first.
Alternatively, does anyone know of a decent WYSIWYG editor on par with CKEditor / Cute Editor that supports image uploading and will work in ASP.NET MVC?
Here is a image uploader I originally wrote in ASP.NET WebForms for Fckeditor (hence the theme no longer matches), that I've modified to work with Ckeditor.
https://github.com/mcm-ham/ckeditor-image-uploader
Update: I've now added an example showing how you can add this WebForms image uploader to a MVC project.
Update 2: I've now added a Razor Pages version which can be used in .NET Core MVC projects.
Here is a tutorial on how to upload image with ASP:NET MVC2 (not Webforms) using CKEditor
http://arturito.net/2010/11/03/file-and-image-upload-with-asp-net-mvc2-with-ckeditor-wysiwyg-rich-text-editor/
I have used ckeditor and the upload control using ASP.NET, but not MVC specifically. I haven't found anything on par with ckeditor that is even close to being as easy to set up or offers the same features.
Not sure of the restrictions for MVC, but I set up file upload support by using the following:
The basic documentation referring mostly to the CKFinder plugin you mentioned:
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_%28Uploader%29
Better documentation on how to implement the upload component:
How can you integrate a custom file browser/uploader with CKEditor?
Otherwise, I believe ckeditor just stuffs all the image bytes in the request object and sends it to the page configured for uploading. This page can take those bytes and do whatever it pleases (i.e. save them to the file system, sql server, etc.) This is where the custom implementation comes in.
Instead of using a page to do the upload, I used an httphandler implementation. The page ckeditor redirects to calls the requisite javascript function to indicate the status of the upload after it is complete, but the handler really controls the actual file upload. The basic implementation for the httphandler I used is at:
http://darrenjohnstone.net/2008/07/15/aspnet-file-upload-module-version-2-beta-1/
Hope this at least gives you a starting point.
UPDATE: found this while searching for some other stuff. Didn't look at in depth, but seems to be right up your alley:
http://interactiveasp.net/blogs/spgilmore/archive/2009/06/03/how-to-support-file-uploads-in-asp-net-mvc.aspx
If you need to implement it quickly and have a reliable solution, you may consider a hosted solution to upload and store images for CKEditor - for example, our plugin:
http://ckeditor.com/addon/uploadcare

Why are there designer files (*.designer.cs) in ASP.NET MVC?

What's the point of the auto-generated 'designer' files in ASP.NET MVC Web Apps?
I'm trying out ASP.NET MVC (coming from ASP.NET Webforms projects), so I'm used to just having the one code file with each ASP.NET markup file (.aspx, .ascx etc.). Can I use the code beside model with MVC Apps instead as less files seems simpler?
Thanks.
The designer.cs files are a hold over from Web Application projects (which MVC is a derivative of). Along with the regular code behind files, they are no longer needed with the latest MVC RC.

Resources