$file = $_FILES['file']; $fileId = F3::get('POST["fileId"]'); //###Create Signer, ApiClient and Storage Api objects //Create signer object $signer = new GroupDocsRequestSigner($privateKey); //Create apiClient object $apiClient = new APIClient($signer); //Create Storage Api object $storageApi = new StorageApi($apiClient); //Check is user entered base path if ($basePath == "") { //If base base is empty seting base path to prod server $basePath = 'https://api.groupdocs.com/v2.0'; } //Set base path $storageApi->setBasePath($basePath); //Check if user choose upload file from URL if ($url != "") { //Upload file from URL try { $uploadResult = $storageApi->UploadWeb($clientId, $url); //Check is file uploaded if ($uploadResult->status == "Ok") { //Get file GUID $fileGuId = $uploadResult->result->guid; $fileId = ""; //If it isn't uploaded throw exception to template } else { throw new Exception($uploadResult->error_message); } } catch (Exception $e) {
//Create Doc Api object $docApi = new DocApi($apiClient); //Create Storage Api object $apiStorage = new StorageApi($apiClient); //Create AsyncApi object $api = new AsyncApi($apiClient); $mergApi = new MergeApi($apiClient); $signatureApi = new SignatureApi($apiClient); //Set url to choose whot server to use if ($basePath == "") { //If base base is empty seting base path to prod server $basePath = 'https://api.groupdocs.com/v2.0'; } //Set base path $docApi->setBasePath($basePath); $apiStorage->setBasePath($basePath); $api->setBasePath($basePath); $mergApi->setBasePath($basePath); $signatureApi->setBasePath($basePath); //Get entered by user data $name = F3::get('POST["name"]'); $lastName = "lastName"; $email = F3::get('POST["email"]'); $country = F3::get('POST["country"]'); $city = F3::get('POST["city"]'); $street = F3::get('POST["street"]'); F3::set("email", $email); F3::set("country", $country); F3::set("name", $name); F3::set("lastName", $lastName); F3::set("street", $street);