[wp-trac] [WordPress Trac] #47049: Unzip_file causing Media file upload error

WordPress Trac noreply at wordpress.org
Fri Apr 26 05:54:42 UTC 2019


#47049: Unzip_file causing Media file upload error
---------------------------+------------------------------
 Reporter:  troytempleman  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Upload         |     Version:  5.1.1
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by mehrshaddarzi):

 I tested it.
 Where do you want to use this code?
 When uploading any file in WordPress? Or at the time of sending a form?
 You need a WordPress hook. e.g.

 {{{#!php
 add_action('add_attachment', function( $post_ID ){
 $file_path = get_attached_file( $post_ID );
 // Do unzip file
 });
 }}}

 or

 `add_action('init', function() { if(isset($_FILE)) { ....`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47049#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list