Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File attachement with AJAX #17

Closed
mm-tom opened this issue May 16, 2014 · 3 comments
Closed

File attachement with AJAX #17

mm-tom opened this issue May 16, 2014 · 3 comments

Comments

@mm-tom
Copy link

mm-tom commented May 16, 2014

I'm having trouble receiving attachments when using AJAX form submission.

I'm passing the form data through with:

var data = new FormData(this);

Because serialize() won't work on file fields, but unfortunately this still isn't working (email is sent, attachment ignored).

Any ideas?

@brandonkelly
Copy link
Member

I'm not sure there is a great way to submit file uploads and post data in the same Ajax request, unfortunately. What we came up with for Craft's Get Help widget was, we just post the form to a hidden iframe, rather than submit an actual Ajax request.

@mm-tom
Copy link
Author

mm-tom commented May 16, 2014

OK! Thanks :)

@Bronskiy
Copy link

There is an answer https://craftcms.stackexchange.com/a/21386/5587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants