When attempting to replace an existing file on an S3 source, the upload fails. Here's the sequence of events:

  1. Upload file sample_image.jpg for the first time (works fine)
  2. Click 'Upload' and select sample_image.jpg again from the local filesystem
  3. Click 'Replace Existing File' button in modal window when prompted by Assets
  4. The Assets loading bar appears but remains empty forever and the new file is not uploaded.

In the console, this error displays:

Uncaught SyntaxError: Unexpected token <

This issue does not happen when uploading to a local directory, only when uploading to an S3 directory.

  • EE 2.9.2
  • Assets 2.5
  • Can you try clicking on the error to be shown the actual HTTP response? That error message sounds like the request didn't get routed to Assets properly, and you're getting some sort of "bad request" HTML response instead. Commented Mar 18, 2015 at 22:59
  • Have you tried updating indexes? Commented Mar 18, 2015 at 23:36
  • @BrandonKelly Clicking on the error doesn't do anything, there doesn't seem to be anything else to see. In the network tab I see garnish-0.1.min.map as being loaded...
    – kmgdev
    Commented Mar 19, 2015 at 17:05
  • @kgrote Off to the right of the error, then? There will be a filename and line number that the error is associated with, and you should be able to click on it to view it. Commented Mar 19, 2015 at 17:06
  • @BrandonKelly Yup: admin.php, line 1 - clicking it reveals a totally blank file.
    – kmgdev
    Commented Mar 19, 2015 at 17:08

2 Answers 2


We finished this up via email support. This is a known bug and will be fixed in the next release (2.5.1, I believe). P&T sent me an advanced copy and it resolved the issue.


Was this ever fixed in the most recent version? I seem to be running into the same thing using the most recent version. Using Assets with S3. File uploads work fine, but when replacing an image with the same name, it hangs up.

cc/ @brandon-kelly

Getting the following error when trying to replace:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.