-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to upload an image using joeblogs on wordpress blog? #28
Comments
You need to upload a byte[] |
You mean that i should convert the filepath type to byte[] rather than String or What? Please give me an example? |
Yes, Can you use Fiddler and find out what is going over the wire? I suspect it's an issue like this: In which case it's a bug in the library |
Sorry Sir, i read the post but i didn't get what actually is to be done! I reckon there is a need to amend sort of data type in your liberary or what? Please let me know what other solution i can try? |
Use fiddler |
Ok Sir, i look into it! |
Content-Length: 33547 And fault message is being sent as response from the server! |
What else should i try? I mean could you provide your snippet to upload an image so that i could try! |
No, look at the actual content of the message being sent. The body
|
Yes i checked the body in xml view,its actually sending the image with sort of tags and there i could see a tag like base64 and sort of numerical code there! I am new to fiddler so probably i can't be telling you explicitly what you want to know about! But please if you could show me a method of uploading an image, would then certainly be appreciated! |
can you copy paste exactly what is in the body onto here, i'll take a look On 9 July 2013 14:46, Shahid Sultan Minhas [email protected] wrote:
|
Text view of the packet! faultCode 500 faultString Could not write file wpid-ERD-Diagram (Invalid file type) Or tell me how can i get to content of packet if you have any aquaintance with fiddler? I mean when i click on a packet, there you can see many options on the right of window where acc. to me, i am clicking on inspector tab and there you can see lot many other options like which view you want to see like xml, json,text view etc!By far, i have converted the String to byte via this code of mine as: wrapper.UploadFile(newpic, "ERD Diagram", true, "image/jpg"); // method referring your liberary to upload an image. |
Looks ok to me... Will have to leave the issue open for when I get time. On 9 July 2013 15:30, Shahid Sultan Minhas [email protected] wrote:
|
I think I know what the problem is. You have to convert IMAGE to byte arry, not image path.
This will work for you. :) |
Shahid, You were missing the file extension for the name of the file. It's asking for uploaded filename, not image title. Hope this helps |
I am new to joeblogs wordpress remote publishing liberary and trying to upload an image with some post to my wordpress blog! Any code snippet to upload an image?
I have tried that string:
wrapper.UploadFile(@"C:\Users\Thomas janes\Pictures\qw.JPG","ERD Diagram",true,"image/jpeg");
but it returned me an exception saying that Server returned a fault exception: [500] Could not write file wpid-ERD-Diagram (Invalid file type). Whta does this mean and why is it occurring?
The text was updated successfully, but these errors were encountered: