Last active
October 8, 2025 06:18
-
-
Save TiloGit/f360d0ff2f21b08789064c4528e07b99 to your computer and use it in GitHub Desktop.
Revisions
-
TiloGit revised this gist
Oct 8, 2025 . 1 changed file with 10 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,10 +11,20 @@ $basicAuthValue = "Basic $encodedCreds" $Headers = @{ Authorization = $basicAuthValue } # Define form data as a hashtable $formData = @{ "cmisaction" = "createFolder" "succinct" = "true" "propertyId[0]" = "cmis:objectTypeId" "propertyValue[0]" = "cmis:folder" "propertyId[1]" = "cmis:name" "propertyValue[1]" = $folderName } # Send POST request Invoke-WebRequest -Uri $url -Method Post -Body $formData -Headers $Headers ############## ### create file in CMIS ############## @@ -66,12 +76,3 @@ Invoke-RestMethod -Uri $url ` -Headers @{ Authorization = $basicAuthValue; "Content-Type" = "multipart/form-data; boundary=$boundary" } ` -Body $payload -
TiloGit revised this gist
Oct 8, 2025 . 2 changed files with 77 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,25 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,77 @@ #### create Folder # Generate timestamp $myDate = get-date -uformat "%Y-%m-%d_%s" $folderName = "tilo_folder_$myDate" # Define URL and credentials $url = "http://99.99.97.146:8077/cmis/browser/Y8/root" $pair = "admin:mypass" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) $basicAuthValue = "Basic $encodedCreds" $Headers = @{ Authorization = $basicAuthValue } # Define form data as a hashtable $formData = @{ "cmisaction" = "createFolder" "succinct" = "true" ############## ### create file in CMIS ############## # Generate timestamp $myDate = Get-Date -UFormat "%Y-%m-%d_%s" # Define URL and credentials $url = "http://99.99.97.146:8077/cmis/browser/Y8/root" $pair = "admin:mypass123" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) $basicAuthValue = "Basic $encodedCreds" $boundary = "$([System.Guid]::NewGuid().ToString('N'))" ##generate payload $payload = @" --$boundary Content-Disposition: form-data; name="cmisaction" createDocument --$boundary Content-Disposition: form-data; name="propertyId[0]" cmis:name --$boundary Content-Disposition: form-data; name="propertyValue[0]" test_$myDate.txt --$boundary Content-Disposition: form-data; name="propertyId[1]" cmis:objectTypeId --$boundary Content-Disposition: form-data; name="propertyValue[1]" cmis:document --$boundary Content-Disposition: form-data; name="media"; filename="test_$myDate.txt" Content-Type: text/plain test tilo here at $myDate --$boundary-- "@ $payload = $payload -replace "`n","`r`n" Invoke-RestMethod -Uri $url ` -Method Post ` -Headers @{ Authorization = $basicAuthValue; "Content-Type" = "multipart/form-data; boundary=$boundary" } ` -Body $payload "propertyId[0]" = "cmis:objectTypeId" "propertyValue[0]" = "cmis:folder" "propertyId[1]" = "cmis:name" "propertyValue[1]" = $folderName } # Send POST request Invoke-WebRequest -Uri $url -Method Post -Body $formData -Headers $Headers -
TiloGit revised this gist
Oct 2, 2025 . 2 changed files with 23 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ ##create folder below myDate=$(date +"%Fat%s") curl -u admin:mypass -X POST http://99.99.97.146:8077/cmis/browser/Y8/root -d \ "cmisaction=createFolder" -d \ "succinct=true" -d \ "propertyId[0]=cmis:objectTypeId" -d \ "propertyValue[0]=cmis:folder" -d \ "propertyId[1]=cmis:name" -d \ "propertyValue[1]=tilotestfolder_$myDate" ##create file below myDate=$(date +"%Fat%s") echo "test tilo here at $myDate" > test-tilo.txt curl -u admin:mypass \ -X POST \ -H "Content-Type: multipart/form-data" \ -F "cmisaction=createDocument" \ -F "propertyId[0]=cmis:name" \ -F "propertyValue[0]=test_$myDate.txt" \ -F "propertyId[1]=cmis:objectTypeId" \ -F "propertyValue[1]=cmis:document" \ -F "[email protected]" \ http://99.99.97.146:8077/cmis/browser/Y8/root -
TiloGit revised this gist
Sep 26, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ myDate=$(date +"%Fat%s") curl -u admin:mypass -X POST http://99.99.97.146:8077/cmis/browser/Y8/root -d \ "cmisaction=createFolder" -d \ "succinct=true" -d \ "propertyId[0]=cmis:objectTypeId" -d \ -
TiloGit revised this gist
Sep 25, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ myDate=$(date +"%Fat%s") curl -u admin:mypass -X POST -u admin:mypass http://99.99.97.146:8077/cmis/browser/Y8/root -d \ "cmisaction=createFolder" -d \ "succinct=true" -d \ "propertyId[0]=cmis:objectTypeId" -d \ -
TiloGit created this gist
Sep 25, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # Generate timestamp $myDate = get-date -uformat "%Y-%m-%d_%s" $folderName = "tilo_folder_$myDate" # Define URL and credentials $url = "http://99.99.97.146:8077/cmis/browser/Y8/root" $pair = "admin:mypass" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) $basicAuthValue = "Basic $encodedCreds" $Headers = @{ Authorization = $basicAuthValue } # Define form data as a hashtable $formData = @{ "cmisaction" = "createFolder" "succinct" = "true" "propertyId[0]" = "cmis:objectTypeId" "propertyValue[0]" = "cmis:folder" "propertyId[1]" = "cmis:name" "propertyValue[1]" = $folderName } # Send POST request Invoke-WebRequest -Uri $url -Method Post -Body $formData -Headers $Headers This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ myDate=$(date +"%Fat%s") curl -u admin:mypass -X POST -u admin:admin http://99.99.97.146:8077/cmis/browser/Y8/root -d \ "cmisaction=createFolder" -d \ "succinct=true" -d \ "propertyId[0]=cmis:objectTypeId" -d \ "propertyValue[0]=cmis:folder" -d \ "propertyId[1]=cmis:name" -d \ "propertyValue[1]=tilotestfolder_$myDate"