{Result: ""}
​
​
var client = new CodeMashClient(apiKey, projectId);var filesService = new CodeMashFilesService(client);​var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);var filePath = $"{directory}\\test.txt";​using (var fsSource = new FileStream(path, FileMode.Open, FileAccess.Read)){var response = await filesService.UploadFileAsync(fsSource, "test.txt",new UploadFileRequest{Path = "folder1"});}
​
use Codemash\CodemashClient;use Codemash\CodemashFile;​class CodemashService{protected CodemashFile $codemashFile;​public function __construct(){$secretKey = '{YOUR_SECRET_KEY}';$projectId = '{YOUR_PROJECT_ID}';​$client = new CodemashClient($secretKey, $projectId);$this->codemashFile = new CodemashFile($client);}​public function uploadFile(){$responseData = $this->codemashFile->uploadFile(['path' => 'folder1','fileUri' => '{YOUR_FILE_PATH}','fileName' => '{YOUR_FILE_NAME}',]);}}
{Result: ""}
​
​
var client = new CodeMashClient(apiKey, projectId);var filesService = new CodeMashFilesService(client);​var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);var filePath = $"{directory}\\test.txt";​using (var fsSource = new FileStream(path, FileMode.Open, FileAccess.Read)){var response = await filesService.UploadRecordFileAsync(fsSource, "test.txt",new UploadRecordFileRequest{RecordId = "{RECORD_ID}",UniqueFieldName = "file_field_name"});}
​
use Codemash\CodemashClient;use Codemash\CodemashFile;​class CodemashService{protected CodemashFile $codemashFile;​public function __construct(){$secretKey = '{YOUR_SECRET_KEY}';$projectId = '{YOUR_PROJECT_ID}';​$client = new CodemashClient($secretKey, $projectId);$this->codemashFile = new CodemashFile($client);}​public function uploadRecordFile(){$responseData = $this->codemashFile->uploadRecordFile(['fileUri' => '{YOUR_FILE_PATH}','fileName' => '{YOUR_FILE_NAME}','collectionName' => '{COLLECTION_NAME}','recordId' => '{RECORD_ID}','uniqueFieldName' => 'file_field_name',]);}}
{Result: ""}
​
​
var client = new CodeMashClient(apiKey, projectId);var filesService = new CodeMashFilesService(client);​var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);var filePath = $"{directory}\\test.txt";​using (var fsSource = new FileStream(path, FileMode.Open, FileAccess.Read)){var response = await filesService.UploadUserFileAsync(fsSource, "test.txt",new UploadUserFileRequest{UserId = "{USER_ID}",MetaFieldName = "file_field_name"});}
​
use Codemash\CodemashClient;use Codemash\CodemashFile;​class CodemashService{protected CodemashFile $codemashFile;​public function __construct(){$secretKey = '{YOUR_SECRET_KEY}';$projectId = '{YOUR_PROJECT_ID}';​$client = new CodemashClient($secretKey, $projectId);$this->codemashFile = new CodemashFile($client);}​public function uploadUserFile(){$responseData = $this->codemashFile->uploadUserFile(['fileUri' => '{YOUR_FILE_PATH}','fileName' => '{YOUR_FILE_NAME}','userId' => '{USER_ID}','metaFieldName' => 'file_field_name',]);}}