Skip to content

Commit

Permalink
Merge pull request #720 from Crypter-File-Transfer/feature/parted-upl…
Browse files Browse the repository at this point in the history
…oads

Multipart file transfers
  • Loading branch information
Jack-Edwards authored Sep 10, 2024
2 parents f8ae192 + f5b6061 commit 583a6f2
Show file tree
Hide file tree
Showing 90 changed files with 4,328 additions and 809 deletions.
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadFileTransferReceipt
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadFileTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadFileTransferBundle
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadFileTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadMessageTransferReceipt
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadMessageTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadMessageTransferBundle
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadMessageTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
1 change: 1 addition & 0 deletions Crypter.API/Controllers/Base/TransferControllerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ protected IActionResult MakeErrorResponse(UploadTransferError error)
{
UploadTransferError.UnknownError => MakeErrorResponseBase(HttpStatusCode.InternalServerError, error),
UploadTransferError.InvalidRequestedLifetimeHours
or UploadTransferError.TooLarge
or UploadTransferError.OutOfSpace => MakeErrorResponseBase(HttpStatusCode.BadRequest, error),
UploadTransferError.RecipientNotFound => MakeErrorResponseBase(HttpStatusCode.NotFound, error)
};
Expand Down
Loading

0 comments on commit 583a6f2

Please sign in to comment.