Ticket #2656 (closed bug: invalid)
serialize() ignores input type=file
| Reported by: | mingyuchang | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.4 |
| Component: | ajax | Version: | 1.2.3 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
the output generated from serialize function with respect to a form doesn't include those values in the file type fileds
Change History
comment:1 Changed 4 years ago by dmethvin
- Component changed from core to ajax
- Summary changed from serialize function of form misses the file field to serialize() ignores input type=file
comment:2 follow-up: ↓ 5 Changed 4 years ago by brandon
- Status changed from new to closed
- Resolution set to invalid
The serialize method can't get the contents of the file so I don't understand why it would need to serialize the file form field. You'd have to use one of the Ajax File upload plugins to get the contents via AJAX.
comment:3 follow-up: ↓ 4 Changed 21 months ago by MrIsaacs
what is an appropriate solution for sending files via ajax?
comment:5 in reply to: ↑ 2 Changed 15 months ago by adam.jimenez@…
Replying to brandon:
The serialize method can't get the contents of the file so I don't understand why it would need to serialize the file form field. You'd have to use one of the Ajax File upload plugins to get the contents via AJAX.
It's useful to get the filename for validation.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Seems like a pretty simple fix, it looks like the test for type just needs to have file added to it.