Exemple #1
0
        public void UploadFile(FileShell fileShell)
        {
            var imageUploader = GetUploader(_settings.Capture.Uploader);

            if (imageUploader is null)
            {
                throw new Exception($"Image uploader '{_settings.Capture.Uploader}' does not exist.");
            }

            var mime = new Mime();

            var mimeNode = fileShell.Path is { } ? mime.DetectFile(fileShell.Path) : mime.Detect(fileShell.Data);
Exemple #2
0
        public void ProcessWithoutUpload(FileShell fileShell)
        {
            var mime = new Mime();
            var node = mime.Detect(fileShell.Data);

            var saveResult = new SaveResult
            {
                Time = DateTime.Now.ToUnixTime()
            };

            OnUploaded(fileShell, null, saveResult, node.FileType, node.Extension, null);
            fileShell.Dispose();
        }
Exemple #3
0
 public void AddToQueue(FileShell fileShell)
 {
     _uploadQueue.Enqueue(fileShell);
 }