4

I'm trying to level up files (putObject) with my app running on Plesk, Zend 1.0 + SDK 2.0 from Amazon but returning the following error:

Fatal error: Uncaught exception 'Guzzle\Common\Exception\InvalidArgumentException' with message 'Invalid resource type' in /var/www/vhosts/domain/library/Amazon/Guzzle/Http/EntityBody.php:50 Stack trace: #0 /var/www/vhosts/domain/library/Amazon/Aws/Common/Client/UploadBodyListener.php(85): Guzzle\Http\EntityBody::factory(false) #1 [internal function]: Aws\Common\Client\UploadBodyListener->onCommandBeforePrepare(Object(Guzzle\Common\Event)) # ...

  • To download the files (GetObject) works normally.
starball
  • 20,030
  • 7
  • 43
  • 238
Ivan Celso
  • 41
  • 1
  • 4
  • 1
    What does your PutObject code look like? From this error, it seems like there might be something incorrect about the way you are specifying the arguments. – Jeremy Lindblom Aug 02 '13 at 17:58
  • check this it solved there. http://stackoverflow.com/questions/1165122/php-fatal-error-uncaught-exception-exception-problem –  Mar 25 '14 at 12:47
  • This usually happens when your object doesn't exist or it's damaged, or not exactly what you thought it was... But you need to share more information along with the code for people to be able to assist you! – Neo Sep 27 '14 at 00:03
  • Did you ever figure this out? I'm saving the same problem. – Nate Nov 17 '14 at 17:15
  • I am also facing the same issue. Does anyone was able to solve this issue? – MutantMahesh Jul 24 '15 at 14:19

1 Answers1

0

This might be a character encoding issue.

I was running into a similar issue while transferring some text fields between a MySQL database and DynamoDB. Certain special characters like é were not valid UTF-8 characters. And even though they were replaced with the replacement character (), for some reason this was throwing a fatal error. I ended up having to run a check on all the fields before they were put into the database and convert the encoding to ASCII (which was the type all the other strings were set to). Instead of the replacing the unknown characters, a ? was used so it wasn't a "good" fix, but it did prevent the script from crashing.

This is my best guess though as all I have to go off of is the error being similar to the one I was getting. And seeing as this question is old, thought I would attempt to answer it in case anyone else comes across this like me.