#6559 closed enhancement (duplicate)
The information on the file posted by xmlrpc cannot be changed by wp_handle_upload.
Reported by: | jyoshida | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5 |
Component: | XML-RPC | Keywords: | |
Focuses: | Cc: |
Description
- The part corrected by #3395 is overwritten.
The wp_handle_uplaod filter cannot access the uploaded file.
- apply_filters() is called after wp_insert_attachment().
Even if wp_handle_upload rewrites an information, it is recorded on the database for the information before a modification.
Attachments (1)
Change History (9)
#1
follow-up:
↓ 3
@
17 years ago
- Cc josephscott added
I'm not sure I follow, isn't the current XML-RPC behavior the same as uploading a file via wp-admin? See wp_handle_upload( ) in wp-admin/includes/file.php.
Hmmm, I'm tempted to say that we should be using wp_handle_upload( ) in XML-RPC.
#3
in reply to:
↑ 1
@
17 years ago
Replying to josephscott:
I'm not sure I follow, isn't the current XML-RPC behavior the same as uploading a file via wp-admin? See wp_handle_upload( ) in wp-admin/includes/file.php.
No, it is different.
For example, in wp-admin/include/media.php media_handle_upload(), wp_handle_upload() is called before wp_insert_attachment().
I think that meida_handle_upload() is used from a dashboard when an image file is uploaded. The wp_handle_uplaod filter can access the uploaded file and can also perform the updation of file information.
Hmmm, I'm tempted to say that we should be using wp_handle_upload( ) in XML-RPC.
I think that a good idea replaces apply_filters() by wp_handle_uplaod().
#4
@
17 years ago
In general I think it is best to push filters/hooks/etc. down further into WordPress than to have them higher up in the XML-RPC code. This tends to reduce unnecessary code duplication.
Can you put together a patch that makes use of the wp_handle_upload( ) function instead?
#5
@
17 years ago
It was tried. But it failed. wp_handle_upload() was made so that a file might be received by $_FILES. It seems that the file made from wp_upload_bit() cannot be handled.
#6
@
16 years ago
- Keywords needs-patch added
- Milestone changed from 2.9 to Future Release
- Type changed from defect (bug) to enhancement
The patch to xmlrpc