public Yield PutFile(DreamContext context, DreamMessage request, Result <DreamMessage> response) { var filepath = GetPath(context); var ttl = context.GetParam("ttl", 0.0); TimeSpan?timeToLive = null; if (ttl > 0.0) { timeToLive = TimeSpan.FromSeconds(ttl); } try { _s3Client.PutFile(filepath, new AmazonS3FileHandle { Stream = request.ToStream(), Size = request.ContentLength, MimeType = request.ContentType, TimeToLive = timeToLive }); response.Return(DreamMessage.Ok()); } catch (Exception e) { throw new DreamBadRequestException(e.Message); } yield break; }
public void PutFile(string path, AmazonS3FileHandle fileInfo) { Client.PutFile(path, fileInfo); }