I'm POSTing a video using the Facebook graph API video endpoint, everything working fine. But I can't figure out how to provide a custom thumbnail. The API says to provide a thumb parameter:
The video thumbnail raw data to be uploaded and associated with a video.
But what exactly does 'raw data' mean? I've tried encoding it as base 64 (with and without data:image/jpeg;base64, prepended, but always get the error:
OAuthException
(#100) Invalid image format. It should be an image file data.
I get the same using the graph API explorer.
I'm using C# (via ASP.NET Web API).
I see similar questions online about other languages, but no .NET friendly solution.
API version 2.9.
Thanks
Related
So, I'm quite new to the ASP.NET MVC framework. What I need to do is make an API endpoint for a webserver which accepts a HTTP post request that has an image file uploaded to it.
I've looked around and I'm really not sure how to handle this. The closest I've come is this resource:
File Upload and Multipart MIME - ASP.NET Web API
Is this pretty much the only way to do it?
No, you can also send it across as a class that has a string property that contains the base64 encoded contents of the file. You then have to decode the base64 in the web api method (which is still a post) and then save or use the file bytes.
From the client's stand point, the most straight-forward way of doing it is multipart mime. But your question was about web api, and it can handle base64 in say, a json object just fine.
If you don't use multipart mime you'll need javascript that converts the upload into base64. That part of it is beyond the scope of your question.
But strictly speaking multipart is not the only way because I had such a javascript file upload library and that's what I used and it worked fine.
The reason why we used that component was because we wanted thumbnail upload preview of the images (preview first), then a submit button to actually submit to web api. javascript held the images in localstorage until the user hit submit (was a multiple image upload thing).
I've been able to successfully post to my blog using this library, but can't figure out how to upload and reference images with the post (similar to how Picasa's "Blog This" feature works).
There is no straightforward way. The images uploaded on Blogger are first uploaded to Picasaweb. So you need to work on picasa as well as Blogger API.
You can try the following steps:
Create a UI to select image from your system.
Use Google Picasa API to Upload image.
Get link of the uploaded Image and add it to your Blog's HTML code.
I am facing a problem that I cannot seem to overcome.
Context
I have an iOS application running on iOS7.0 and greater. In this application, you have the possibility to post pictures with comments. These pictures and comments are then sent to a .NET C# MVC WebAPI, which itself sends the content to Facebook using the Facebook SDK.
Problem
When I post comments with emoticons on the iOS app, I am able to successfully store the comments in the database through the Web API and to retrieve them. It shows properly as emoticons on the iOS app. However, once the comment is sent to Facebook, it shows the actual text stored in the database (normal, I guess).
I would like however to have Facebook display the emoticon I am sending from the emoji keyboard on iOS.
Comments with emoticon !! \ud83d\ude04\ud83d\ude0d
Additional Information
On iOS, I take the string containing the comment, I first encode it using UTF8 and I return a new string using NonLossyASCII.
To display it on iOS, I take the string shown above and I do the opposite; I encode it using NonLossyASCII and return a new string using UTF8.
Any hint or help would be highly appreciated.
Till now, I was converting image to Base64String and then send it to Asp.NET server and convert it to image there. But recently, I came to know that HttpPostelFile is good method for it. I Google for some example but din't get anyone.
Please anyone help me to upload file from Android Device to Asp.NET Server using HttpPostedFile or any another good method.
I want it using Asp.NET Web Service.
I need to extract an image/thumbnail from a video hosted on some website. For exemple, the host could be youtube.com or whatever.com and i want to extract an image for a precise frame, i.e 2:12.
I have the direct URL for the video. I searched and found how to do it for youtube or vimeo, they provide xml or json with a path to the thumbnail. However i can't find how to do it for a web site that doesn't provide those informations.
Ive downloaded FFmpeg, but it doesn't seem to offer to extract an image from a video hosted on some web site.
Any other tool or any idea to make a tool myself ?
Thanks
I'm guessing that you are trying to do this on server side, and as far as I know you then need to transfer the video over to the server and run ffmpeg, as you already suggested.