Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: post
title: Save document to AWS S3 in ASP.NET MVC Document editor | Syncfusion
description: Learn about how to Save document to AWS S3 in ASP.NET MVC Document editor of Syncfusion Essential JS 2 and more details.
title: Save document to AWS S3 in ASP.NET MVC DOCX Editor | Syncfusion
description: Learn about how to save document to AWS S3 in ASP.NET MVC Document Editor of Syncfusion Essential JS 2 and more details.
platform: document-processing
control: Save document to AWS S3
documentation: ug
Expand All @@ -10,15 +10,15 @@ domainurl: ##DomainURL##

# Save document to AWS S3 in ASP.NET MVC

To save a document to AWS S3, you can follow the steps below
To save a document to AWS S3, you can follow the steps below.


**Step 1:** Create a Simple Document Editor Sample in ASP.NET MVC
**Step 1:** Create a simple Document Editor sample in ASP.NET MVC

Start by following the steps provided in this [link](../getting-started) to create a simple Document Editor sample in ASP.NET MVC. This will give you a basic setup of the Document Editor component.


**Step 2:** Modify the `DocumentEditorController.cs` File in the Web Service Project
**Step 2:** Modify the `DocumentEditorController.cs` file in the web service project

* Open the `DocumentEditorController.cs` file in your web service project.

Expand All @@ -31,7 +31,7 @@ using Amazon.S3;
using Amazon.S3.Model;
```

* Add the following private fields and constructor parameters to the `DocumentEditorController` class, In the constructor, assign the values from the configuration to the corresponding fields
* Add the following private fields and constructor parameters to the `DocumentEditorController` class. In the constructor, assign the values from the configuration to the corresponding fields:

```csharp
private IConfiguration _configuration;
Expand All @@ -50,7 +50,7 @@ public DocumentEditorController(IWebHostEnvironment hostingEnvironment, IMemoryC
}
```

* Create the `SaveToS3()` method to save the document to AWS S3 bucket
* Create the `SaveToS3()` method to save the document to the AWS S3 bucket:

```csharp

Expand Down Expand Up @@ -97,7 +97,7 @@ private string GetValue(IFormCollection data, string key)
}
```

* Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration
* Open the `appsettings.json` file in your web service project. Add the following lines below the existing `"AllowedHosts"` configuration:

```json
{
Expand All @@ -114,11 +114,11 @@ private string GetValue(IFormCollection data, string key)
}
```

N> Replace **Your Access Key from AWS S3**, **Your Secret Key from AWS S3**, and **Your Bucket name from AWS S3** with your actual AWS access key, secret key and bucket name
N> Replace **Your Access Key from AWS S3**, **Your Secret Key from AWS S3**, and **Your Bucket name from AWS S3** with your actual AWS access key, secret key, and bucket name.

**Step 3:** Modify the Index.cshtml File in the Document Editor sample

In the client-side, to export the document into blob the document using `saveAsBlob` and sent to server-side for saving in AWS S3 Bucket.
On the client side, export the document as a blob using `saveAsBlob` and send it to the server side for saving in the AWS S3 bucket.


{% tabs %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: post
title: Save to Azure Blob Storage in ASP.NET MVC Document editor | Syncfusion
description: Learn about how to Save document to Azure Blob Storage in ASP.NET MVC Document editor control of Syncfusion Essential JS 2 and more details.
title: Save to Azure Blob Storage in ASP.NET MVC DOCX Editor | Syncfusion
description: Learn about how to Save document to Azure Blob Storage in ASP.NET MVC DOCX Editor control of Syncfusion Essential JS 2 and more details.
platform: document-processing
control: Save document to Azure Blob Storage
documentation: ug
Expand All @@ -15,7 +15,7 @@ To save a document to Azure Blob Storage, you can follow the steps below

**Step 1:** Create a Simple Document Editor Sample in ASP.NET MVC

Start by following the steps provided in this [link](../getting-started) to create a simple Document Editor sample in ASP.NET MVC. This will give you a basic setup of the Document Editor component.
Start by following the steps provided in this [link](../getting-started) to create a simple Document Editor sample in ASP.NET MVC. This will give you a basic setup of the Document Editor component.


**Step 2:** Modify the `DocumentEditorController.cs` File in the Web Service Project
Expand All @@ -32,7 +32,7 @@ using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Specialized;
```

* Add the following private fields and constructor parameters to the `DocumentEditorController` class, In the constructor, assign the values from the configuration to the corresponding fields
* Add the following private fields and constructor parameters to the `DocumentEditorController` class. In the constructor, assign the values from the configuration to the corresponding fields:

```csharp
private readonly string _storageConnectionString;
Expand All @@ -47,7 +47,7 @@ public DocumentEditorController(IConfiguration configuration, ILogger<DocumentEd
}
```

* Create then 'SaveToAzure' method to save the downloaded documents to Azure Blob Storage container
* Create the `SaveToAzure` method to save the downloaded documents to the Azure Blob Storage container:

```csharp

Expand All @@ -56,7 +56,7 @@ public DocumentEditorController(IConfiguration configuration, ILogger<DocumentEd
[Route("[controller]/SaveToAzure")]
//Post action for downloading the documents

public void Download(IFormCollection data)
public void SaveToAzure(IFormCollection data)
{
if (data.Files.Count == 0)
return;
Expand Down Expand Up @@ -93,7 +93,7 @@ private string GetValue(IFormCollection data, string key)

```

* Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration
* Open the `appsettings.json` file in your web service project. Add the following lines below the existing `"AllowedHosts"` configuration:

```json
{
Expand All @@ -109,11 +109,11 @@ private string GetValue(IFormCollection data, string key)
}
```

N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name
N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name.

**Step 3:** Modify the Index.cshtml File in the Document Editor sample

In the client-side, to export the document into blob the document using `saveAsBlob` and sent to server-side for saving in Azure Blob Storage container.
In the client-side, to export the document into a blob using `saveAsBlob` and send it to server-side for saving in the Azure Blob Storage container:


{% tabs %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
req.onreadystatechange = () => {
if (req.readyState === 4) {
if (req.status === 200 || req.status === 304) {
console.log('Saved sucessfully');
console.log('Saved successfully');
}
}
};
Expand Down