Transloadit.Assembly.AssemblyBuilder.AddFile C# (CSharp) Méthode

AddFile() public méthode

Adds file to the current assembly
public AddFile ( string path ) : void
path string Path of the file
Résultat void
        public void AddFile(string path)
        {
            string key = FilenameKeyPrefix + (fileIncrement++) + FilenameKeyPostfix;
            AddFile(key, path);
        }

Same methods

AssemblyBuilder::AddFile ( string key, string path ) : void

Usage Example

        public void ResizeImageNonExistingFile()
        {
            ITransloadit transloadit = new Transloadit.Transloadit();
            IAssemblyBuilder assembly = new AssemblyBuilder();
            assembly.AddFile(@"test_non_existing.jpg");

            IStep step = new Step();
            step.SetOption("robot", "/image/resize");
            step.SetOption("width", 75);
            step.SetOption("height", 75);
            step.SetOption("resize_strategy", "pad");
            step.SetOption("background", "#000000");

            assembly.AddStep("thumb", step);

            TransloaditResponse response = transloadit.InvokeAssembly(assembly);

            Assert.IsTrue((string)response.Data["ok"] == "ASSEMBLY_COMPLETED" || (string)response.Data["ok"] == "ASSEMBLY_EXECUTING");
            Assert.IsTrue(((System.Collections.ArrayList)(response.Data["uploads"])).Count == 0);
        }
All Usage Examples Of Transloadit.Assembly.AssemblyBuilder::AddFile