Jump to content

Jquery file upload with form


Marcel Epp
 Share

Recommended Posts

Greetings Congomonster,

This will work!  You need to incorporate this plugin (or one like it), into your site's existing code for handling file uploads.  So you first build the form to handle file uploads, then add the plugin to target the file-upload field.

Take a look at these discussions on file-uploads in ProcessWire forms:

https://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/

https://gist.github.com/somatonic/5236008

Thanks,

Matthew

  • Like 2
Link to comment
Share on other sites

Greetings,

File uploads are a tricky business. This is not about ProcessWire -- it's just the nature of the web. Everythng needs to be just right for the files to end up in the proper place.

Here's a quick checklist of obvious reasons you could encounter for file uploads to not work, ordered roughly by likelihood:

1. Did you create the temp dirctory to store the files during processing?

2. In the ProcessWire back-end, did you set the file field to accept the right kind/number of files?

3. In your code, did you first run an initial $page->save() before doing final file-upload steps? In other words, your page should be saved (at least) two times.

4. Did you set your form to be ready for the proper enctype?

5. Did you set file-upload fields to accept multiple files (if doing this)?

If none of those fit, follow up here!

Thanks,

Matthew

Link to comment
Share on other sites

Greetings Matthew,

thank you for your help. i got the basics done. I now have a form where i can upload one file and this file got saved into a page.

How can i hide this pages by default (published and hide)? And how can i store more than one file?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...