Title: [Plugin: W3 Total Cache] CDN Image Uploads
Last modified: August 19, 2016

---

# [Plugin: W3 Total Cache] CDN Image Uploads

 *  Resolved [Alex Rodriguez](https://wordpress.org/support/users/alexrodriguez/)
 * (@alexrodriguez)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/)
 * Hi-
 * I am having trouble using W3 Total Cache with Amazon CloudFront. Its all setup
   and my images (content) is transferred to the Amazon CDN however not ALL of the
   content is transferred.
 * For example for every image I upload wordpress has three files they are wp-created-
   150×150.jpg, wp-created-199×300.jpg and original-upload.jpg. The only one I uploaded
   was the original-upload.jpg. The problem I am having is the W3 Total Cache is
   only sending the wp-created-150×150.jpg and wp-created-199×300.jpg to the CDN.
 * Any help/suggestions will be appreciated.
 * Alex

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

 *  [ljg3](https://wordpress.org/support/users/ljg3/)
 * (@ljg3)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1426637)
 * I was having the same problem. I took a look through the code and it seems as
   though the way the upload functionality was written that it skips the original
   files now. Here’s the code in particular, lib/W3/Plugin/Cdn.php starting at line
   655:
 *     ```
       if (isset($metadata['file'])) {
       	$files = array_merge($files, $this->get_metadata_files($metadata));
       } elseif (!empty($post->file)) {
       	$file = $this->normalize_attachment_file($post->file);
       	$local_file = $upload_info['upload_dir'] . '/' . $file;
       	$remote_file = $upload_info['upload_url'] . '/' . $file;
       	$files[$local_file] = $remote_file;
       }
       ```
   
 * I rewrote the logic so it always includes the main file, in addition to files
   found in the metadata:
 *     ```
       if (!empty($post->file)) {
       	$file = $this->normalize_attachment_file($post->file);
       	$local_file = $upload_info['upload_dir'] . '/' . $file;
       	$remote_file = $upload_info['upload_url'] . '/' . $file;
       	$files[$local_file] = $remote_file;
       }
       if (isset($metadata['file'])) {
       	$files = array_merge($files, $this->get_metadata_files($metadata));
       }
       ```
   
 * After that, I had a much larger group of files uploaded, and everything seems
   to be working correctly. You could also make the change in the function that 
   processes the metadata looking for files, but I’ll leave that decision up to 
   the plugin author.
 * -Lew
 *  Thread Starter [Alex Rodriguez](https://wordpress.org/support/users/alexrodriguez/)
 * (@alexrodriguez)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1426814)
 * hmm, that seems strange. I wonder if its a bug or an intentional feature?
 *  [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1426845)
 * This is fixed in the next release coming shortly.
 *  Thread Starter [Alex Rodriguez](https://wordpress.org/support/users/alexrodriguez/)
 * (@alexrodriguez)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1426923)
 * Great! I eagerly wait for its arrival.
 * Thank you for this great plugin!
 * Alex
 *  [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1426971)
 * Meanwhile you can download the development release here and you should be all
   set: [http://wordpress.org/extend/plugins/w3-total-cache/download/](http://wordpress.org/extend/plugins/w3-total-cache/download/)
 *  Thread Starter [Alex Rodriguez](https://wordpress.org/support/users/alexrodriguez/)
 * (@alexrodriguez)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1426972)
 * Got it! Its working great. Thanks again!
 *  [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1426986)
 * You’re welcome.
 *  [photosensibility](https://wordpress.org/support/users/photosensibility/)
 * (@photosensibility)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1427000)
 * I’m having the same problem. The images appear to be renamed on Cloudfront (they
   all have 220×146 added just before .jpg). Why is this?
 * If I download the plugin again, are you saying it’s fixed (even though the version
   name hasn’t changed from what I already have)? If I update the plugin, will I
   have to repeat uploading the media library, etc.?
 * Or if I just wait, any idea how long before the next release?
 * Thanks.
 *  [photosensibility](https://wordpress.org/support/users/photosensibility/)
 * (@photosensibility)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1427001)
 * Hmm, if I want to apply just the fix for this problem, can I upload specific 
   files (e.g., w3-total-cache.php)?
 * I’m afraid that if I just drag and drop in the new version, I’ll overwrite something
   that shouldn’t be overwritten…
 *  [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1427002)
 * Files that are uploaded don’t have to be re-uploaded. You should deactivate the
   previous plugin and install the development version.
 *  Thread Starter [Alex Rodriguez](https://wordpress.org/support/users/alexrodriguez/)
 * (@alexrodriguez)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1427008)
 * Just remove or uninstall the one you have now and then install the development
   version.
 * That is how I did it and it works great!
 *  [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1427024)
 * Excellent.

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

The topic ‘[Plugin: W3 Total Cache] CDN Image Uploads’ is closed to new replies.

## Tags

 * [CloudFront](https://wordpress.org/support/topic-tag/cloudfront/)

 * 12 replies
 * 4 participants
 * Last reply from: [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-w3-total-cacheplugin-w3-total-cache/#post-1427024)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
