Upload File to Azure Blob Storage through Rest API

Hi,

I have requirement to upload the pdf/image file to Azure Blob Storage through Rest API  and once upload the file, the document name should display on page.

User should click on document name and see the uploaded document.

How we can achieve this requirement in Outsystems ? any reference ? 


Thanks 

Hi Suraj,

Like I said in the other topic, if you really have no clue how to do this with OutSystems, you aren't trained enough to do it, even if we tell you how. Please visit the training material and take a few courses before trying to use OutSystems. It's a great development tool, but no tool can be used without at least some knowledge.

Hi Suraji,

  I'd suggest going through the training again but to give you somewhere to start. Have a look at the Azure Blob Storage component in the forge

https://www.outsystems.com/forge/component-overview/1745/azure-blob-storage

Once you have that working then to display the result you can put an "expression" on the page, connect it to a variable then put the filename in there. Then you need to remember to call an Ajax Refresh on either the expression or the container that the expression is in. Remember to give the expression or container a name otherwise it won't come up as an option in the refresh.

Then to retrieve the file you put a link wrapper around the expression and in the screen action call the relevant action from the Azure Blob component. Then you use the Download action in your code and it has a binary property, set that to the property that was returned by the azure component.


Kilian,

I agree that further training is required to be able to build this but at the end of the day this is the forums where developers go to get help. Even the most experienced developers refer to this from time to time. Refusing to help because you think 'they're not trained enough' is disgraceful especially in the way you portrayed it in your comment. If you can't help, don't respond.

Hey Suraj

I was able to accomplish this by doing the following:

1. Install the Multiple File Upload & Azure Blob Storage forge components

2. Reference both of them in your application and create an upload screen. Your upload screen must have a dropzone container. This is just a normal container which has an onDrop event of

"$('.DropZone').removeClass('DropZoneBackground');"

and onClick event of

"$('.qq-uploader .qq-upload-button input')[0].click();"

3. Place the MultipleFileUpload web block in your page and set them the following properties (The UploadSessionName session variable could be used as an identifier for the file you upload. Mine is empty for the sake of demonstration)

 4. In the preparation of the /UploadTest/Upload page, you need to add the UploadBlob action, from the Azure Blob Storage component, after the checks. the requirement for me was to upload the document to Azure and only save the file meta data in OutSystems. Thats why I've got a CreateBlobMeta action, which saves the file name in an Entity defined in OutSystems.

The UploadBlob actions takes in your Azure Connection String and Container Id as input parameters. These are easy to obtain after you create your container in the Azure dashboard.

5. My Upload page lists the files in Azure as well as the meta data saved in OutSystems therefore, my OnNotify function of the MultipleFileUpload web block Refreshes the Metadata aggregate in the preparation and list variables holding these values

This is the final result:

Ossama