Post file from Android to Asp.NET Server using HttpPostedFile - c#

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.

Related

How to upload video thumbnail to Facebook graph API (.NET)?

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

MVC Web API 2 - File Upload from mobile devices

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).

How to access clipboard image and save it at server location in asp.net web application?

I wish to have the following feature in my web application:
On the client side When I copy an image from anywhere (it gets loaded to the clipboard), now I wish to have a button on which when I click it should save the image at the server location at some path.
I am ok to use anything javascript, jquery, c# at server side code just need the implementation of the above feature.
Please help.
Thanks a lot in advance.
Vaibhav
Check out this question and answers to it: How does the paste image from clipboard functionality work in Gmail and Google Chrome 12+? .
I think the most difficult part is to get it working in all browsers. So if you need older browsers support you probably should use some flash solution like http://code.google.com/p/zeroclipboard/ .
To save it to server you need some controller's POST action (if using MVC) or webservice or aspx page if using webforms. After getting clipboard image with javascript you send it to the server using AJAX for example.

Extract an image from a video hosted on a web site

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.

How do I post a file over HTTP via public API in ASP NET?

I have a web application. I am using C#. I have existing methods in my API for various things but all only submit and return bool/int/strings.
All of my API methods have the directive
System.ServiceModel.OperationContract
All the parameters are of
System.Runtime.Serialization.DataMember
I would like to be able to receive a posted file over HTTP. Apologies if this is a very simple question, but I'm not sure where to start so I don't know what to google. All I've been finding is people attempting to save a HttpPostedFile after submitting it in a form.
Thanks in advance for any help.
EDIT: this will be called from an iPhone application. Not via the browser on the iPhone
Basically, I would like to do this: http://www.flickr.com/services/api/upload.api.html
Your question is somewhat confusing. But if you are asking how to receive a file via HTTP in an ASP.NET web app... the answer is the FileUpload control. It doesn't really matter what browser (iPhone) the client is using.
Are you submitting the file via a web application or a desktop app?

Categories

Resources