File Upload(Image and Video) using Akamai's NetStorage CMS API in C# - c#

I am trying to use the Akamai's NetStorage CMS API for uploading images and videos using asp.net fileupload and looking for any C# REST API(Controller) where we can call NetStorage Upload method.
Looked in their documentation and googled for AKamai CMS API file upload C#, but returned with no luck.
I know how to upload a txt file using Akamai upload method and write content to that text file, but i am looking for something like:
User selects a file
Use that file and upload to Akamai file storage
And when user edits that image(example to rename image title or author info) , get the image from Akamai storage.
Any help would be greatly appreciated.
Thank you so much in advance.

There is a NetStorageKit for C# here:
https://github.com/akamai-open/NetStorageKit-C-Sharp

Related

How to retrieve url of the image uploaded on Amazon S3

I am new to Amazon S3. I want to upload all my images / PDF to S3 and let the user access those by using the URL. I am reading up the documentation and landed on this page:
http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpNET.html
This sample only uploads the image. How would I get the URL of the uploaded image so I can store them in my database and my user can use them to view the image?
For eg. Shouldn't it offer some url like http://aws.amazon.com/bucket-name/image-name.jpg and then I can type in that url in the browser and view my uploaded image from amazon.
Any help is appreciated.
Amazon don't give you the URL because the structure is already know before you upload a file.
http(s)://<bucket>.s3.amazonaws.com/<object>
http(s)://s3.amazonaws.com/<bucket>/<object>
You already know the bucket name, and the object name when you do the upload - S3 doesn't need to 'tell' you anything, you have the information - in fact you told S3 what the file name will be.

can we get the onedrive uploaded file link after upload is completed?

I am uploading the file to One drive using Rest Api c# successfully.My requirement is to get the uploaded file link and push that into database.when I Googled I cannot find any relevant information on that.kindly help me to solve this query
Getting a download link is documented here: Downloading and Uploading files (REST) (https://msdn.microsoft.com/en-us/library/dn659726.aspx). At the bottom, it states "To get a download link to the contents of a file, photo, video, or audio, use code like this.
GET https://apis.live.net/v5.0/file.a6b2a7e8f2515e5e.A6B2A7E8F2515E5E!126/content?suppress_redirects=true?
access_token=ACCESS_TOKEN
"
I hope this helps.

How to get image from url using c# / javascript

I am using file picker apis , i can easily upload my files to there server and they give me a unique url in return . When it comes to again fetch that file its creating a problem to me .
You can tell me how to get back file using that url by using filepicker api .
You can tell me how to use that url and get image , by using c#
When i upload a picture to filepicker.io they return me a json object like following
[{"url":"https://www.filepicker.io/api/file/kIrtNvQRta7GxlFVfiP2","filename":"brazil.jpg","mimetype":"image/jpeg","size":2660,"key":"ZML3OjrFTVyV4waBzRIT_brazil.jpg","isWriteable":true}]
So how to get back that image file using c# / Filepicket javascript api
Edit
In my site user will come and upload many photos , and every link to that photo will be stored in database . Now if user want to see his uploaded pictures then i want to fetch them again from server by url . So give your solutions acc. to this scenario .
Thanks in advance
You could put the picture in a PictureBox first using: PictureBox.Load(string);
After the PictureBox is filled with the image from the url, you can decide what to do next like: saving etc.
PictureBox.Load

How to get the progress while uploading a file in C# ? And want to display it in JS

I'm using Ext JS 4.0 for all my layout and ASP.net C# for the server side.
I'm doing a multiple file upload.
I already have a progress bar for each file uploading in JS. But I don't have the progress value (So it's always 0%).
I need to know the progression and for which file.
I'm using XMLHttpRequest in JS, I get a HttpPostedFileBase in C# and use the SaveAs(path) method to save the file on the server.
Thanks in advance !

How to programatically upload/post an image to an image hosting website without a browser?

I want to write a simple utility to upload images to various free image hosting websites like TinyPic or Imageshack via a right-click context menu for the file.
How can I do this using .NET? I've seen some linux scripts that use cURL to post images to these website but I'm not sure how I could create the post request, complete with an image in C#?
Can someone point me in the right direction?
EDIT:
I've found a pretty good resource. Cropper, a free screenshot tool written in .net, has a lot of open-source plugins. One of them is a SendToTinyPic.. complete with source. Link here:
http://www.codeplex.com/cropperplugins
The FlickrNet API makes this extremely easy for working with Flickr from .NET. You have to have a Flickr account as well as an API key and shared secret. Once you have what you need, working with the API is very simple:
// http://www.flickr.com/services/api/misc.api_keys.html
string flickrApiKey = "<api key>";
string flickrApiSharedSecret = "<shared secret>";
string flickrAuthenticationToken = "<authentication token>";
Flickr flickr = new Flickr( flickrApiKey, flickrApiSharedSecret );
flickr.AuthToken = flickrAuthenticationToken;
foreach ( FileInfo image in new FileInfo[] {
new FileInfo( #"C:\image1.jpg" ),
new FileInfo( #"C:\image2.jpg" ) } )
{
string photoId = flickr.UploadPicture(
image.FullName, image.Name, image.Name, "tag1, tag2" );
}
Use HttpWebRequest.
Using this class, you can POST data to a remote HTTP address, just set the mime/type to multi-part/form encoded, and post the binary data from the image with the request.
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(VS.71).aspx
For ImageShack, take a look to this Application.
TinyPic.com doesn't have an API as far as I know, but the Cropper SendToTinyPic Plugin tries to upload using "Screen scraping". The official version of the plugin doesn't work right now, but I put together a patch using the same approach, and submitted it to the cropperplugins project. It's just one source module that changed. Anyone can download the plugins project, and then drop in my patch and it should work.
With the patch, it's PritScrn or Alt-PrntScrn will save the image and upload to tinypic, and stuff the URL of the raw image on your clipboard. All in 2 seconds. easy.
If you don't want the actual tool, you can still look at the source code of my patch to see how to POST a page with form-data and a file upload. No direct link. See http://cropperplugins.codeplex.com/SourceControl/PatchList.aspx and look for #3239.
This example image was produced and then auto-uploaded to tinypic.com with the Alt-PrtScrn key-combo.
To embed it here, I just had to ctrl-V because the URL is stored on the clipboard.

Categories