prazi Posted June 28, 2013 Share Posted June 28, 2013 I am new to Yii framework and reading "The Yii book" to understand Yii. The book is really excellent and I am enjoying it. In my project I have a controller called "UserController" and also have the associated model "User" and related View files created using Gii. On the "/user/create" page I am uploading user profile picture. Its all working fine from the create page.However, when I try to upload the picture using REST Client (I am using Chrome - Advanced REST Client) the picture is unable to upload. If I upload all the other text (e.g email, firstname etc) details except the picture on the REST Client form then the user is created successfully but when I try to upload a picture along with the rest of the details then it fails. Actually, when I tried to debug then I came to know that while submitting the form with image from the REST client, it enters the "public function actionCreate()" function but does not go into the if(isset($_POST['User'])) { // code} condition. However, it works successfully if I upload image and details from the "/user/create" page.Once again, I would like to say that the image gets uploaded successfully from the actual webpage created using Yii but the image cannot be uploaded using the REST client inspite of setting Content-type as "multipart/form-data".ThanksPrazi Link to comment Share on other sites More sharing options...
Larry Posted June 28, 2013 Share Posted June 28, 2013 Thanks for the nice words. It is appreciated! Since you haven't provided any code at all, I'm guessing here, but are you trying to upload the file (and do everything else) via Ajax? Link to comment Share on other sites More sharing options...
prazi Posted July 2, 2013 Author Share Posted July 2, 2013 Hi Larry, Thanks for your reply. Much appreciated. Well my problem is now SOLVED. Thanks.I tried other chrome REST Client extension named "Postman" and was able to upload images from this client really easily. I think I was not able to use the "Advanced REST Client" to upload images but this "Postman REST Client" is really super cool and easy to use. Thanks Prasad. Link to comment Share on other sites More sharing options...
Larry Posted July 3, 2013 Share Posted July 3, 2013 Glad you were able to get it working and thanks for sharing what you've learned. Link to comment Share on other sites More sharing options...
Recommended Posts