Skip to content

Instantly share code, notes, and snippets.

View fardeen9983's full-sized avatar
๐ŸŒš
I have the Power

Fardeen Khan fardeen9983

๐ŸŒš
I have the Power
View GitHub Profile
@fardeen9983
fardeen9983 / UploadController.cs
Created March 31, 2022 12:05
Expose FileUploadService
namespace CodePanthers.AWS.S3.UploadService.Controllers
{
[Route("Upload")]
public class UploadController : Controller
{
private readonly IFileUploadService _fileUploadService;
public UploadController(IFileUploadService fileUploadService)
{
_fileUploadService = fileUploadService;
}
@fardeen9983
fardeen9983 / FileUploadService.cs
Last active March 31, 2022 11:56
File Upload Service
/// <summary>
/// Generates a presigned URL of the file if it is successfully uploaded to S3
/// </summary>
/// <param name="file">File to be Uploaded</param>
/// <returns></returns>
public async Task<string> GetS3ObjectPresignedUrl(IFormFile file)
{
try
{
var key = Path.GetRandomFileName() + Guid.NewGuid().ToString() + Path.GetExtension(file.FileName).ToLowerInvariant();
@fardeen9983
fardeen9983 / README.md
Last active April 13, 2019 19:07
Following the tutorial on freeCodeCamp.org Node.js FULL TUTORIAL : https://www.youtube.com/watch?v=RLtyhwFtXQA
  • Initiate the node project npm init
  • Create app.js
  • Write console logs and run