Uploading material to azure storage - c#

I have developed ASP.NET application, and I used for uploading materials to my local pc following code:
filename = Path.GetFileName(FileUpload1.FileName);
FileUpload1.SaveAs(Server.MapPath("~/uploadfile/") + filename);
Label1.Text = "Upload status: File uploaded!";
Now, I want this to upload on Azure and what I need is to change this code to suit uploading to my azure website. I have made storage there, but I don't know how should I code it. I have tried searching on google, but documentation is at least to say, horrible and very confusing. Any help is appreciated.
Thanks in advance.

It isn't entirely clear to me what you are trying to do. Normally in ASP.Net applications you aren't actually trying to upload images from the local computer on which but actually want to have the user be able to use their browser to select an image from their computer. If that is what you are trying to do there are lots of samples out there. Here is a good one from the Mobile Services site, or here is another example - although it appears to use an older version of the storage client library so make sure you upgrade to the >= 4.0 version of the library if you take this app further than prototype. For a good overview of Blob storage look here.
If you are indeed simply trying to upload materials to / from your local PC to Blob Storage then take a look at AzCopy instead - it might be simpler.

Related

Windows 10 UWP App: Easiest place to upload a large file to?

If a user has a problem with our UWP app that I can't reproduce, I want to give the user a button, so she can upload the sqlite database to somewhere where I can access it. The zipped database could be up to 160 MB.
My question is where is the easiest place to upload a large file to using UWP. Pushbullet, OneDrive, Dropbox? Or I could FTP it to somewhere (am about to try this out FtpClient). I've noticed that Chilkat can help with this, but it's not free.
My question is where is the easiest place to upload a large file to using UWP.
The better way is using OneDrive to upload sqlite database. It has enough memory capacity, And you could easily use OneDrive API in the uwp app. This is OneDrive Service you could refer.
And this is code sample.

How do I upload file to google drive?

I have checked out tons of links for upload file directly in Google Drive.
I have created a sample application and it's working as expected, but the problem is it's requires the user to login with Google account.
I want to make an web application, where the user who's selecting file can directly upload it to example#gmail.com Google drive. So user don't have to signing with own google account.
How can I achieve a goal?
It's a great help if you have a sample code for this.
Thanks in Advance
As you said, Google Drive needs an account to authenticate and know where to upload the file.
If you want to upload it to a shared place, then create an account for that purpose and use those credentials to log in.
But for your case, if it's not a requirement to use google drive but just a cloud file storage, SmartFile is a lot better for that kind of programs, I'm using it in my own projects and works like a charm, check the Developer account, it gives you 100Gb of space and 200Gb of monthly traffic, and uses a very clean REST api (I have no relatinoship with them, just a happy user).
https://www.smartfile.com/

ASP.NET -Search and access local disk or network files in web

How can i search and download local disk files from web?
some codes available for searching local disk files by C#. but not web based....
please help me friends for searching algorithm..
Thanks,
regards,
Raj.
I can suggest you some asp.net web File Browsers, like ckfinder and a source code from codeproject.
http://ckfinder.com/
http://www.codeproject.com/Articles/301328/ASP-NETUser-Control-File-Browser
From the moment you select your file, you can simple click on it to get it, or use a http handler to send it to the client.

Updating A Small Application

I've made a small application for fun and I want to implement an update feature.
I don't really have a remote server or anything. I thought I could use a file hosting site to host my application. So :
Does anyone know a good site which I can easily download files from? (not like rapidshare that you have to wait. more like a direct link.)
How can I make the application check if there is an update.
DONT link me to CLICK-ONCE, it seems way too complex for my needs. I just need a creative solution so that my program can ask : "update available?, if yes, give me the link".
You can use Amazon Web Services S3 and CloudFront to host your application files. If you don't want to use ClickOnce, you could simply have the application download a text file that has the latest version number from a predefined update site. Have your program compare it with the current running version and if there is a new version available pop-up a message with a link to download the new installer.
Whenever you have a new version, simply upload your new installer and update the version text file with the new version number.

Uploading/Pushing Data To A Website

I need to let a company push information up to my site.
The best way to explain what I am talking about is to explain how it is currently done with their previous website:
This company uploads a CSV file to an FTP set up by the website. The website then processes the CSV file and puts it into an SQL database so that it can be used by the website.
In this case, I am the website and I am working with the company. Both sides are willing to change what they do. So my question is...
What is the best way to accept batch information like this? Is there a more automated way that doesn't involve FTP? In the future I may have a lot of companies wanting to do this, and I'd hate to have to setup accounts for each one.
The project is C# ASP.NET MSSQL
Let me know if you need more information...
Set up a web service to accept incoming data. That way you can validate immediately and reject bad data before it ever gets into your system.
If you want to eliminate FTP, you could allow them to upload files to your site leveraging using FileUpload. Once the file is uploaded you can do your server side processing.
EDIT: From the OP's comment's it seems to be an automated process. That said, if their process generates the file, you could:
Allow them to continue their current process which would involve them generating their file and placing it somewhere where it could be accessed via a URI with authentication, you could access this file on a schedule and process it. From what it seems right now they generate a file and upload it to your FTP server, so there seems to a manual element to begin with.

Categories