Skip to content

Commit 825e613

Browse files
Updates for upload/download articles
1 parent 68ea4a5 commit 825e613

10 files changed

+186
-70
lines changed

articles/storage/blobs/storage-blob-download-java.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,44 @@ ms.custom: devx-track-java, devguide-java
1616

1717
# Download a blob with Java
1818

19-
This article shows how to download a blob using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme). You can download a blob by using any of the following methods:
19+
This article shows how to download a blob using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme). You can download blob data to various destinations, including a local file path, stream, or text string. You can also open a blob stream and read from it.
20+
21+
## Prerequisites
22+
23+
To work with the code examples in this article, make sure you have:
24+
25+
- An authorized client object to connect to Blob Storage data resources. To learn more, see [Create and manage client objects that interact with data resources](storage-blob-client-management.md).
26+
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operation:
27+
- [Get Blob](/rest/api/storageservices/get-blob#authorization)
28+
- The package **azure-storage-blob** installed to your project directory. To learn more about setting up your project, see [Get Started with Azure Storage and Java](storage-blob-java-get-started.md#set-up-your-project).
29+
30+
## About downloading blobs
31+
32+
The [Get Blob](/rest/api/storageservices/put-blob) operation reads or downloads a blob from Azure Storage, including its metadata and properties. To learn more about the `Get Blob` operation, including timeout parameters and error conditions, see [Get Blob remarks](/rest/api/storageservices/get-blob#remarks).
33+
34+
## Download a blob
35+
36+
You can use any of the following methods to download a blob:
2037

2138
- [downloadContent](/java/api/com.azure.storage.blob.specialized.blobclientbase)
2239
- [downloadStream](/java/api/com.azure.storage.blob.specialized.blobclientbase)
2340
- [downloadToFile](/java/api/com.azure.storage.blob.specialized.blobclientbase)
2441

2542
## Download to a file path
2643

27-
The following example downloads a blob by using a file path:
44+
The following example downloads a blob to a local a file path:
2845

2946
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobDownload.java" id="Snippet_DownloadBLobFile":::
3047

3148
## Download to a stream
3249

33-
The following example downloads a blob to an `OutputStream`:
50+
The following example downloads a blob to an `OutputStream` object:
3451

3552
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobDownload.java" id="Snippet_DownloadBLobStream":::
3653

3754
## Download to a string
3855

39-
The following example downloads a blob to a `String` object. This example assumes that the blob is a text file.
56+
The following example assumes that the blob is a text file, and downloads the blob to a `String` object:
4057

4158
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobDownload.java" id="Snippet_DownloadBLobText":::
4259

articles/storage/blobs/storage-blob-download-javascript.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,28 @@ ms.custom: devx-track-js, devguide-js
1616

1717
# Download a blob with JavaScript
1818

19-
This article shows how to download a blob using the [Azure Storage client library for JavaScript](https://www.npmjs.com/package/@azure/storage-blob). You can download a blob by using any of the following methods:
19+
This article shows how to download a blob using the [Azure Storage client library for JavaScript](https://www.npmjs.com/package/@azure/storage-blob). You can download blob data to various destinations, including a local file path, stream, or text string.
20+
21+
## Prerequisites
22+
23+
To work with the code examples in this article, make sure you have:
24+
25+
- An authorized client object to connect to Blob Storage data resources. To learn more, see [Create and manage client objects that interact with data resources](storage-blob-client-management.md).
26+
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operation:
27+
- [Get Blob](/rest/api/storageservices/get-blob#authorization)
28+
- The package **@azure/storage-blob** installed to your project directory. To learn more about setting up your project, see [Get started with Azure Blob Storage and JavaScript](storage-blob-javascript-get-started.md).
29+
30+
## About downloading blobs
31+
32+
The [Get Blob](/rest/api/storageservices/put-blob) operation reads or downloads a blob from Azure Storage, including its metadata and properties. To learn more about the `Get Blob` operation, including timeout parameters and error conditions, see [Get Blob remarks](/rest/api/storageservices/get-blob#remarks).
33+
34+
## Download a blob
35+
36+
You can use any of the following methods to download a blob:
2037

2138
- [BlobClient.download](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-download)
2239
- [BlobClient.downloadToBuffer](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-downloadtobuffer-1) (only available in Node.js runtime)
2340
- [BlobClient.downloadToFile](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-downloadtofile) (only available in Node.js runtime)
24-
25-
> [!NOTE]
26-
> The examples in this article assume that you've created a [BlobServiceClient](/javascript/api/@azure/storage-blob/blobserviceclient) object by using the guidance in the [Get started with Azure Blob Storage and JavaScript](storage-blob-javascript-get-started.md) article. Blobs in Azure Storage are organized into containers. Before you can upload a blob, you must first create a container. To learn how to create a container, see [Create a container in Azure Storage with JavaScript](storage-blob-container-create.md).
2741

2842
## Download to a file path
2943

articles/storage/blobs/storage-blob-download-python.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,24 @@ ms.custom: devx-track-python, devguide-python
1616

1717
# Download a blob with Python
1818

19-
This article shows how to download a blob using the [Azure Storage client library for Python](/python/api/overview/azure/storage). You can download a blob by using the following method:
19+
This article shows how to download a blob using the [Azure Storage client library for Python](/python/api/overview/azure/storage). You can download blob data to various destinations, including a local file path, stream, or text string. You can also open a blob stream and read from it.
20+
21+
## Prerequisites
22+
23+
To work with the code examples in this article, make sure you have:
24+
25+
- An authorized client object to connect to Blob Storage data resources. To learn more, see [Create and manage client objects that interact with data resources](storage-blob-client-management.md).
26+
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operation:
27+
- [Get Blob](/rest/api/storageservices/get-blob#authorization)
28+
- The package **azure-storage-blob** installed to your project directory. To learn more about setting up your project, see [Get Started with Azure Storage and Java](storage-blob-java-get-started.md#set-up-your-project).
29+
30+
## About downloading blobs
31+
32+
The [Get Blob](/rest/api/storageservices/put-blob) operation reads or downloads a blob from Azure Storage, including its metadata and properties. To learn more about the `Get Blob` operation, including timeout parameters and error conditions, see [Get Blob remarks](/rest/api/storageservices/get-blob#remarks).
33+
34+
## Download a blob
35+
36+
You can use the following method to download a blob:
2037

2138
- [BlobClient.download_blob](/python/api/azure-storage-blob/azure.storage.blob.blobclient#azure-storage-blob-blobclient-download-blob)
2239

articles/storage/blobs/storage-blob-download-typescript.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,28 @@ ms.custom: devx-track-ts, devguide-ts
1616

1717
# Download a blob with TypeScript
1818

19-
This article shows how to download a blob using the [Azure Storage client library for JavaScript](https://www.npmjs.com/package/@azure/storage-blob). You can download a blob by using any of the following methods:
19+
This article shows how to download a blob using the [Azure Storage client library for JavaScript](https://www.npmjs.com/package/@azure/storage-blob). You can download blob data to various destinations, including a local file path, stream, or text string.
20+
21+
## Prerequisites
22+
23+
To work with the code examples in this article, make sure you have:
24+
25+
- An authorized client object to connect to Blob Storage data resources. To learn more, see [Create and manage client objects that interact with data resources](storage-blob-client-management.md).
26+
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operation:
27+
- [Get Blob](/rest/api/storageservices/get-blob#authorization)
28+
- The package **@azure/storage-blob** installed to your project directory. To learn more about setting up your project, see [Get started with Azure Blob Storage and TypeScript](storage-blob-typescript-get-started.md).
29+
30+
## About downloading blobs
31+
32+
The [Get Blob](/rest/api/storageservices/put-blob) operation reads or downloads a blob from Azure Storage, including its metadata and properties. To learn more about the `Get Blob` operation, including timeout parameters and error conditions, see [Get Blob remarks](/rest/api/storageservices/get-blob#remarks).
33+
34+
## Download a blob
35+
36+
You can use any of the following methods to download a blob:
2037

2138
- [BlobClient.download](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-download)
2239
- [BlobClient.downloadToBuffer](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-downloadtobuffer-1) (only available in Node.js runtime)
2340
- [BlobClient.downloadToFile](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-downloadtofile) (only available in Node.js runtime)
24-
25-
> [!NOTE]
26-
> The examples in this article assume that you've created a [BlobServiceClient](/javascript/api/@azure/storage-blob/blobserviceclient) object by using the guidance in the [Get started with Azure Blob Storage and TypeScript](storage-blob-typescript-get-started.md) article. Blobs in Azure Storage are organized into containers. Before you can upload a blob, you must first create a container. To learn how to create a container, see [Create a container in Azure Storage with TypeScript](storage-blob-container-create-typescript.md).
2741

2842
## Download to a file path
2943

articles/storage/blobs/storage-blob-download.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ This article shows how to download a blob using the [Azure Storage client librar
2323
To work with the code examples in this article, make sure you have:
2424

2525
- An authorized client object to connect to Blob Storage data resources. To learn more, see [Create and manage client objects that interact with data resources](storage-blob-client-management.md).
26-
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operations:
26+
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operation:
2727
- [Get Blob](/rest/api/storageservices/get-blob#authorization)
28-
- Packages installed to your project directory. These examples use **Azure.Storage.Blobs**. If you're using `DefaultAzureCredential` for authorization, you also need **Azure.Identity**. To learn more about setting up your project, see [Get Started with Azure Storage and .NET](storage-blob-dotnet-get-started.md#set-up-your-project).
28+
- The package **Azure.Storage.Blobs** installed to your project directory. To learn more about setting up your project, see [Get Started with Azure Storage and .NET](storage-blob-dotnet-get-started.md#set-up-your-project).
2929

3030
## About downloading blobs
3131

3232
The [Get Blob](/rest/api/storageservices/put-blob) operation reads or downloads a blob from Azure Storage, including its metadata and properties. To learn more about the `Get Blob` operation, including timeout parameters and error conditions, see [Get Blob remarks](/rest/api/storageservices/get-blob#remarks).
3333

3434
## Download a blob
3535

36-
You can download a blob by using any of the following methods:
36+
You can use any of the following methods to download a blob:
3737

3838
- [DownloadTo](/dotnet/api/azure.storage.blobs.specialized.blobbaseclient.downloadto)
3939
- [DownloadToAsync](/dotnet/api/azure.storage.blobs.specialized.blobbaseclient.downloadtoasync)

articles/storage/blobs/storage-blob-upload-java.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,53 @@ ms.custom: devx-track-java, devguide-java
1616

1717
# Upload a block blob with Java
1818

19-
This article shows how to upload a block blob using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme). You can upload a blob, open a blob stream and write to the stream, or upload blobs with index tags.
19+
This article shows how to upload a block blob using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme). You can upload data to a block blob from a file path, a stream, a binary object or a text string. You can also upload blobs with index tags.
2020

21-
Blobs in Azure Storage are organized into containers. Before you can upload a blob, you must first create a container. To learn how to create a container, see [Create a container in Azure Storage with Java](storage-blob-container-create-java.md).
21+
## Prerequisites
2222

23-
To upload a blob using a stream or a binary object, use the following method:
23+
To work with the code examples in this article, make sure you have:
24+
25+
- An authorized client object to connect to Blob Storage data resources. To learn more, see [Create and manage client objects that interact with data resources](storage-blob-client-management.md).
26+
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operations:
27+
- [Put Blob](/rest/api/storageservices/put-blob#authorization)
28+
- [Put Block](/rest/api/storageservices/put-block#authorization)
29+
- The package **azure-storage-blob** installed to your project directory. To learn more about setting up your project, see [Get Started with Azure Storage and Java](storage-blob-java-get-started.md#set-up-your-project).
30+
31+
## About uploading blobs
32+
33+
The [Put Blob](/rest/api/storageservices/put-blob) operation creates a new block blob, page blob, or append blob, or updates the content of an existing block blob. If you're updating an existing block blob, any existing metadata on the blob is overwritten. To learn more about the `Put Blob` operation, including blob size limitations for write operations, see [Put Blob remarks](/rest/api/storageservices/put-blob#remarks).
34+
35+
The [Put Block](/rest/api/storageservices/put-block) operation creates a new block to be committed as part of a blob.
36+
37+
## Upload data to a block blob
38+
39+
To upload a block blob from a stream or a binary object, use the following method:
2440

2541
- [upload](/java/api/com.azure.storage.blob.blobclient)
2642

27-
To upload a blob using a file path, use the following method:
43+
To upload a block blob from a file path, use the following method:
2844

2945
- [uploadFromFile](/java/api/com.azure.storage.blob.blobclient)
3046

3147
Each of these methods can be called using a [BlobClient](/java/api/com.azure.storage.blob.blobclient) object or a [BlockBlobClient](/java/api/com.azure.storage.blob.specialized.blockblobclient) object.
3248

33-
## Upload data to a block blob
49+
## Upload a block blob from a local file path
3450

35-
The following example uploads `BinaryData` to a blob using a `BlobClient` object:
51+
The following example uploads a file to a block blob using a `BlobClient` object:
3652

37-
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobUpload.java" id="Snippet_UploadBlobData":::
53+
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobUpload.java" id="Snippet_UploadBlobFile":::
3854

3955
## Upload a block blob from a stream
4056

41-
The following example uploads a blob by creating a `ByteArrayInputStream` object, then uploading that stream object:
57+
The following example uploads a block blob by creating a `ByteArrayInputStream` object, then uploading that stream object:
4258

4359
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobUpload.java" id="Snippet_UploadBlobStream":::
4460

45-
## Upload a block blob from a local file path
61+
## Upload a block blob from a BinaryData object
4662

47-
The following example uploads a file to a blob using a `BlobClient` object:
63+
The following example uploads `BinaryData` to a block blob using a `BlobClient` object:
4864

49-
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobUpload.java" id="Snippet_UploadBlobFile":::
65+
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobUpload.java" id="Snippet_UploadBlobData":::
5066

5167
## Upload a block blob with index tags
5268

0 commit comments

Comments
 (0)