I am tired of all these "upload to S3" examples and tutorials that don't work , can someone just show me an example that simply works and is super easy?
C# – How to upload a file to amazon S3 super easy using c#
amazon s3amazon-web-servicescnet
amazon s3amazon-web-servicescnet
I am tired of all these "upload to S3" examples and tutorials that don't work , can someone just show me an example that simply works and is super easy?
Best Answer
well here are the instruction that you have to follow to get a fully working demo program ...
1-Download and install the Amazon web services SDK for .NET which you can find in (http://aws.amazon.com/sdk-for-net/). because I have visual studio 2010 I choose to install the 3.5 .NET SDK.
2- open visual studio and make a new project , I have visual studio 2010 and I am using a console application project.
3- add reference to AWSSDK.dll , it is installed with the Amazon web service SDK mentioned above , in my system the dll is located in "C:\Program Files (x86)\AWS SDK for .NET\bin\Net35\AWSSDK.dll".
4- make a new class file ,call it "AmazonUploader" here the complete code of the class:
5- add a configuration file : right click on your project in the solution explorer and choose "add" -> "new item" then from the list choose the type "Application configuration file" and click the "add" button. a file called "App.config" is added to the solution.
6- edit the app.config file : double click the "app.config" file in the solution explorer the edit menu will appear . replace all the text with the following text :
you have to modify the above text to reflect your Amazon Access Key Id and Secret Access Key.
7- now in the program.cs file (remember this is a console application) write the following code :
8- replace the strings in the code above with your own data
9- add error correction and your program is ready