Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add file upload to Orchard module?

Hi i'm currently working with the CyberStride.Contacts module in Orchard and have been trying to add a file upload to the form, but there seems to be a problem somewhere because the files never upload. Has any one successfully add a fileupload to a module in Orchard, if so could you share how you accomplished this. Thanks.

like image 553
Edward Avatar asked Feb 22 '11 22:02

Edward


2 Answers

In order to be able to upload with a form, that form needs to be multipart. This is why it doesn't work without a couple of tricks.

You can find an example of a file upload in this module: http://orchardproject.net/gallery/List/Modules/Orchard.Module.Contrib.ImageField

like image 153
Bertrand Le Roy Avatar answered Oct 18 '22 13:10

Bertrand Le Roy


Note now there is a FileUpload field here: http://orchardproject.net/gallery/List/Modules/Orchard.Module.Contrib.FileField

Once you install this

  1. Click Content Types on the dashboard.
  2. Click Edit on the Contact Page type.
  3. Under fields, click Add, and add File Field. Thats it!!

When you add a contact form a file upload field will automatically show.

like image 44
gideon Avatar answered Oct 18 '22 13:10

gideon