Title: Files wont upload
Last modified: September 1, 2016

---

# Files wont upload

 *  [Colin](https://wordpress.org/support/users/phazerave/)
 * (@phazerave)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/)
 * I just installed this on my site, and if it ends up working I will be getting
   the pro version. but for some reason it doesnt work at all. creating folders 
   does nothing, and uploading files does nothing, however it does in fact show 
   all folders and files in the wp-content/uploads directory that were there previous
   to the install of the plugin.
 * error log shows nothing at all when files are failing to upload. but I do get
   this while trying to create a directory
    `Trying to create directory at /wp-content/
   uploads/testing, referer: http://educationaltravel.travel/wp-admin/admin.php?
   page=media-library`
 * our php guy took a look at the code and was able to hack it as seen below
 *     ```
       public function get_absolute_path($url) {
          $file_path = str_replace( $this->upload_dir['baseurl'], $this->upload_dir['basedir'], $url );
   
          // Tim's hack starts here
          if (substr($file_path, 0, 12)  == '/wp-content/') {
              $file_path = str_replace('/wp-content/uploads', $this->upload_dir['basedir'], $url);
          }
          // Ends here
       ```
   
 * and gave these comments:
    $this->upload_dir[‘baseurl’] is being set to: [http://educationaltravel.travel/wp-content/uploads](http://educationaltravel.travel/wp-content/uploads)
   It looks like it would work if it was set to: /wp-content/uploads
 * do you have any idea why this may be happening? is there a settings configuration
   I missed somewhere? or is it grabbing that baseurl from somewhere in the database.
 * Would love to get this working! hopefully I was thorough enough in my explanation.
 * [https://wordpress.org/plugins/media-library-plus/](https://wordpress.org/plugins/media-library-plus/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514584)
 * The directory is not created because the function is passed a URL (that include
   [http://](https://wordpress.org/support/topic/files-wont-upload/?output_format=md))
   rather than a file path on the server. On some sites the get_absolute_path() 
   function does not work as expected. We’ll look into what is causing this.
 * Alan
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514655)
 * phazerave,
 * I have added some code to do something similar as the code above does. It in 
   a development version that you will find in developers section, [https://wordpress.org/plugins/media-library-plus/developers/](https://wordpress.org/plugins/media-library-plus/developers/).
   Look for version 3.0.2; download and install it. Let us know if it solves the
   problem.
 *  Thread Starter [Colin](https://wordpress.org/support/users/phazerave/)
 * (@phazerave)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514662)
 * Alan, I actually ended up purchasing the pro version. any way I can get the fix
   for that one? We need the ability to access the plugin features from posts and
   pages. Thanks!
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514663)
 * We were hoping you would test it out. If it worked then we could release a new
   version and include it in MLPP.
 *  Thread Starter [Colin](https://wordpress.org/support/users/phazerave/)
 * (@phazerave)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514664)
 * Ah, ok, I’ll do that now.
 *  Thread Starter [Colin](https://wordpress.org/support/users/phazerave/)
 * (@phazerave)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514666)
 * Unfortunately, the issue was not fixed. Same thing.
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514681)
 * I curious about what is in $this->upload_dir[‘basedir’] and $url. We know that
   $this->upload_dir[‘baseurl’] is [http://educationaltravel.travel/wp-content/uploads](http://educationaltravel.travel/wp-content/uploads).
 * I could send you a version of MLP that will write these to the debug.log if you
   like. Then I should be able to determine why the absolute path is not correct.
 *  Thread Starter [Colin](https://wordpress.org/support/users/phazerave/)
 * (@phazerave)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514696)
 * If you want to email it to me. My email is this backwards: moc.erawtfosniatnuomradec@niloc.
   otherwise just tell me what files to modify and what line, and I can do that.
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514702)
 * Ok, you can add these lines to the get_absolute_path() function at line 1128 
   in maxgalleria-media-library.php.
 *     ```
       $this->write_log($url);
       $this->write_log($this->upload_dir['baseurl']);
       $this->write_log($this->upload_dir['basedir']);
       ```
   
 *  Thread Starter [Colin](https://wordpress.org/support/users/phazerave/)
 * (@phazerave)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514723)
 * here’s what we get back:
 *     ```
       [Thu Jun 30 17:29:20.226915 2016] [:error] [pid 4291] [client 69.144.7.114:55976] /wp-content/uploads, referer: http://educationaltravel.travel/wp-admin/admin.php?page=media-library
       [Thu Jun 30 17:29:20.226949 2016] [:error] [pid 4291] [client 69.144.7.114:55976] http://educationaltravel.travel/wp-content/uploads, referer: http://educationaltravel.travel/wp-admin/admin.php?page=media-library
       [Thu Jun 30 17:29:20.226955 2016] [:error] [pid 4291] [client 69.144.7.114:55976] /var/www/etc-wordpress/wp-content/uploads, referer: http://educationaltravel.travel/wp-admin/admin.php?page=media-library
       [Thu Jun 30 17:29:20.226970 2016] [:error] [pid 4291] [client 69.144.7.114:55976] Trying to create directory at /wp-content/uploads/colin, referer: http://educationaltravel.travel/wp-admin/admin.php?page=media-library
       ```
   
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514724)
 * OK, I’ll review these and get back to you. It looks like $url is missing part
   of the full URL .
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514752)
 * Normally when MLP queries the database for the location of the folder it gets
   a full URL and that is missing in your case. Are you using a CDN or something
   similar to store your images on another server? I encountered some similar in
   debugging a site that had been moved and some of its URLs were no longer correct.
   I fixed it by using the Better Search and Replace plugin to update the old URLs
   but I don’t think that would work in your case.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Files wont upload’ is closed to new replies.

 * ![](https://ps.w.org/media-library-plus/assets/icon-128x128.jpg?rev=1814048)
 * [Media Library Folders](https://wordpress.org/plugins/media-library-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-plus/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [AlanP57](https://wordpress.org/support/users/alanp57/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/files-wont-upload/#post-7514752)
 * Status: not resolved