Hi Rahul, I want to upload multiple files using html. Seems like the current sample doesn't support. It would be great if you could help me with this.
ntri.com/2013/0 2/16/uploading- large-files-in- windows-azure-b lob-storage-usi ng-shared-acces s-signature-htm l-and-javascrip t/ But this fails during upload with "OPTIONS (Aborted) 229 B 31 ms CORS Preflight" error message in the Network panel of IE10. Any idea what settings I should have on the blob storage container? Am I missing something else?
Hi, I'm trying to use the upload control for an application that stores the session state in SQL Azure. This causes an error when trying to set the FileUploadModel class in the session (it looks like this is because CloudBlockBlob cant be serialized). Is there a way to serialize this class or a better place to store than in the session?
Is there a way to use drag-and-drop (dragging the files from windows) without Siverlight (using HTML5)? There are many examples of dragging files to upload using HTML5 but I found none for Azure and just trying the same code in Azure doesn't work (seems to block dragging from OS)
Inbar, The drag and drop feature is an H5 feature and has no relationship with Windows Azure Environment as such. You can use the feature as you have been traditionally using it for any other web application. Just make sure you are using an H5 compatible browser such as IE10, Chrome etc.
Hi, Ive been using mpost's multifile upload with an azure uploader written by S Marx, However, when not connected to Azure have been using the http uploader and had issues with too many concurrent file uploads. Would like to use this, for fast azure upload but would also like multifile upload. Any suggestions?
Hi, Good news! I removed the third party TPL provider for SL5 and the control works just as fine (TPL support comes natively in SL5), I would update the solution soon. The solution is very easy to extend for multi file upload. You just need to change the file selector control to allow selecting multiple files and make a collection of the files. Next, loop through the collection and call the file upload function. If you get stuck anywhere, drop me a mail @ firstname.lastname@example.org
om and I would try to help you through.
Hi, First I want to thank you for posting this solution. I've been using mpost's multifile upload just like acapsis and I've been trying to extend this control to support uploading multiple files. Changing the file selector control to allow selecting multiple files was easy but I couldn't figure out where I should loop through the collection and call the file upload function. I see that the upload button calls the startUpload() in BlockBlobUpload
.js and I've been trying to modify the .js file to loop through the collection. But I ran into all sorts of issues related to how the uploader getting reset before all files are uploaded. Should I execute the loop before the startUpload() is called on the index.cshtml page instead? So when the upload button is clicked, it will loop through the collection and call the startUpload() for each file? What's your recommendation?
@Will: Invoking the script for every file from the page and looping through files from within the script do not make any difference if you want to make uploads in a sequential order. So any approach you take is good.
Hi Rahul, Excellent component. Thaks a ton for sharing it. Now, I am trying to use it in SL5 & I would be doing multifile upload with it. But, my problem is once I convet the project to Silverlight5 the reference to 'PortableTPL' does not work. So, i tried removing 'PortableTPL' and adding 'System.Threadi
ng.Task' instead. But, here I get an error as 'CancellationTo kenSource' is not available. I am also unable to find the TPL support that you said comes natively in SL5. Since, you mentioned you have already successfully tested your component with Silverlight5, it would be very kind of you if you could throw some light on my problem or upload your new solution. Best Regards,
Hi Rahul, Great job, this is really handy. I have two quick questions : Is there any file size limit? When uploading large files (4GB+) is it preferable to use Silverlight? Thanks, Hugo
Hi Hugo, Yes there is a file size limit currently. This sample works for uploads up to 200 MB in size. Of course SL is the preferred way to go when uploading bigger files as SL runs on client (and so does JS on H5). The only caveat is that you should read a part of file and upload it and should proceed so on and not to forget that you may need to generate a Shared Access Signature with a longer expiry time. There have been a ton of requests made to me already to enable the client to upload bigger files and till now I have recommended all of them to follow that approach. (Only if I could get some spare time someday!!!)
Rahul, is the only limitation the MaxFileSizeKB constant, or is there some other reason you have limited the SL uploader to 200MB? It seems a rather arbitrary limit otherwise.
Tom, Due to certain memory limitations, I have observed SL based upload control to break down beyond 200 MB. Since TPL was not available until SL5, I haven't tested the solution to work at higher ranges with the new TPL capability. However, you can play around with the ranges and post your feedback. Thanks.
Hi Rahul, Great library! One that I was going to write (until you pointed me to yours). However, the license seems overly limiting. It is currently licensed under the MS-LPL which includes a clause stating: "(F) Platform Limitation - The licenses granted in sections 2(A) and 2(B) extend only to the software or derivative works that you create that run directly on a Microsoft Windows operating system product, Microsoft run-time technology (such as the .NET Framework or Silverlight), or Microsoft application platform (such as Microsoft Office or Microsoft Dynamics)." This appears to me to preclude use of the HTML 5 part of the software in a public-facing web application since it will be accessed by non-Microsoft run-times (Mac, Linux). A much friendlier license would be the MS-PL (http://www.mic
rosoft.com/en-u s/openness/lice nses.aspx#MPL) or Apache (which the Azure SDKs are now migrating towards). Cheers, -Bill
Thanks for pointing this out. I have changed the licence to Apache so that code becomes more accessible.
Rahul, the license is still shown as the MS-LPL in the code. I figured I'd let you know, since this may cause some confusion.
Hi Rahaul , your component was very usefull for my problem , i all ready modified it to acept multi files and even compress then before the upload but i have a question , have you ever try : (sizes does not matter but it helps to appreciate the question) 1) Upload a big file( more than 20 mb) 2) Give 5 seconds and cancel the upload 3) upload a small file ( less than 1 mb) the small file will last more to be upload ,this is because the first task is still running, so it continues trying to upload all the chuncks of the large file , however does uploads does not pass the http response back because of "if (!this.cancella
tionTokens.IsCa ncellationReque sted)". How can i really cancel the upload?
Fernando, Cancellation does take some time as multiple threads have already collected their payloads and they start doing uploads in parallel. Now, TPL can only signal these threads to stop whatever they are doing by setting its property. It can not kill all the threads because there is no single point to control them. A nice solution would be to use SL5 (I have tested it, you just have to remove reference to the third party DLL and add threading namespaces) and set the maximum number of threads property to a decent number say 5. When user cancels the upload, then do not show cancellation message immediately, but rather wait till those threads have actually come out of processing loop. You can let the progress bar run in animated mode till that time and then allow user to upload the next file. There can be other approaches as well, but this one would be the easiest to implement.
Thank you Rahul , i am going to try what you are saying!
Hi Rahul, This is a great component! I saw the requirement that IE 10 is required for the HTML5 component. Is there anyway to get the HTML5 to support IE 9? Could you share the details of IE9 limitations?
Hi Rahul, Did some research, the component is using HTML5 FileAPI which is not supported by IE9. So it looks like we have to use the Silverlight version instead. Thanks!
Andrew, Yes indeed File API is the limitation in IE9. The SL version should give you more compatibility.
Hi, I am not able to upload the files in the development storage storage configuration = UseDevelopmentS
torage=true. Has anyone faced issues while running this solution using Development fabric and uploading files into Blobs in development storage?
The sample does not work on dev. store because of the reason that storage is not exposed in the as a REST based service by the emulator.