Uploader: return an ID not HTML from async-upload
|Reported by:||tellyworth||Owned by:|
Currently, async-upload.php returns a big chunk of HTML on a successful upload, containing the form for filling in the title, caption etc. It runs to around 4800 bytes.
I've run into a situation where (for reasons unclear) ajax responses are truncated to about 2.5kb. The enclosed patch changes async-upload.php to fix this: instead of HTML it returns the attachment ID only on a successful upload. The HTML form is fetched in a separate ajax request. The result is the same, and -- truncation aside -- I think this is a slightly more elegant and maintainable approach.