file.io

FileUpload

uploadFile

Upload File


/

Usage and SDK Samples

curl -X POST "https://api.apieco.ir/file-io/?expiry="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FileUploadApi;

import java.io.File;
import java.util.*;

public class FileUploadApiExample {

    public static void main(String[] args) {
        
        FileUploadApi apiInstance = new FileUploadApi();
        String apiecoKey = apiecoKey_example; // String | 
        String expiry = expiry_example; // String | The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years.
        File file = /path/to/file.txt; // File | 
        try {
            inline_response_200 result = apiInstance.uploadFile(apiecoKey, expiry, file);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FileUploadApi#uploadFile");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FileUploadApi;

public class FileUploadApiExample {

    public static void main(String[] args) {
        FileUploadApi apiInstance = new FileUploadApi();
        String apiecoKey = apiecoKey_example; // String | 
        String expiry = expiry_example; // String | The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years.
        File file = /path/to/file.txt; // File | 
        try {
            inline_response_200 result = apiInstance.uploadFile(apiecoKey, expiry, file);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FileUploadApi#uploadFile");
            e.printStackTrace();
        }
    }
}
String *apiecoKey = apiecoKey_example; // 
String *expiry = expiry_example; // The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years. (optional)
File *file = /path/to/file.txt; //  (optional)

FileUploadApi *apiInstance = [[FileUploadApi alloc] init];

// Upload File
[apiInstance uploadFileWith:apiecoKey
    expiry:expiry
    file:file
              completionHandler: ^(inline_response_200 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Fileio = require('fileio');

var api = new Fileio.FileUploadApi()

var apiecoKey = apiecoKey_example; // {String} 

var opts = { 
  'expiry': expiry_example, // {String} The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years.
  'file': /path/to/file.txt // {File} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.uploadFile(apiecoKey, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class uploadFileExample
    {
        public void main()
        {
            
            var apiInstance = new FileUploadApi();
            var apiecoKey = apiecoKey_example;  // String | 
            var expiry = expiry_example;  // String | The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years. (optional) 
            var file = new File(); // File |  (optional) 

            try
            {
                // Upload File
                inline_response_200 result = apiInstance.uploadFile(apiecoKey, expiry, file);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FileUploadApi.uploadFile: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\FileUploadApi();
$apiecoKey = apiecoKey_example; // String | 
$expiry = expiry_example; // String | The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years.
$file = /path/to/file.txt; // File | 

try {
    $result = $api_instance->uploadFile($apiecoKey, $expiry, $file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FileUploadApi->uploadFile: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FileUploadApi;

my $api_instance = WWW::SwaggerClient::FileUploadApi->new();
my $apiecoKey = apiecoKey_example; # String | 
my $expiry = expiry_example; # String | The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years.
my $file = /path/to/file.txt; # File | 

eval { 
    my $result = $api_instance->uploadFile(apiecoKey => $apiecoKey, expiry => $expiry, file => $file);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FileUploadApi->uploadFile: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FileUploadApi()
apiecoKey = apiecoKey_example # String | 
expiry = expiry_example # String | The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years. (optional)
file = /path/to/file.txt # File |  (optional)

try: 
    # Upload File
    api_response = api_instance.upload_file(apiecoKey, expiry=expiry, file=file)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FileUploadApi->uploadFile: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key*
String
Required
Form parameters
Name Description
file
File
Query parameters
Name Description
expiry
String
The query param expires must be a positive integer which, by default, represents the number of days until the file will be deleted (defaults to 14 days). If you follow it with w, it will be the number of weeks. m for months and y for years.

Responses

Status: 200 - successful