rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: daniel_boc on January 31, 2018, 07:55:30 PM

Title: File Upload Script
Post by: daniel_boc on January 31, 2018, 07:55:30 PM
Hello,

I am trying to upload files via script. Is there any way to do this via powershell or curl?

I have tried via powershell with this :
#File to Send
$itemName="itemPath"

#http server
$http = "http://meu-ip"
$user = "user"
$pass = "passwd"
$webclient = New-Object System.Net.WebClient
$webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass) 


try{
$uri = New-Object System.Uri($http+"fileDestName.txt")
$webclient.UploadFile($uri, $itemName)}#end try

catch{
$err=$_
Write-Host $error.exception.message
}

but this return erro 404 - Not Found....

And i have tried with this in curl:

curl --user login:password --upload-file "filepath" http://meu-ip/namefile

but this return the same erro 404 - Not Found.


Title: Re: File Upload Script
Post by: bmartino1 on February 03, 2018, 01:50:45 PM
there were other post on the forum with other users trying to upload file to hfs via script. unknown if any were successful.

id use w g e t html-put method or cURL:
https://superuser.com/questions/130009/how-can-i-do-a-http-put-with-wget

here is what i have found on previous posts:

http://rejetto.com/forum/index.php?topic=6813.msg1042159#msg1042159

http://rejetto.com/forum/index.php?topic=6463.msg1039172#msg1039172

http://www.rejetto.com/forum/index.php?topic=4877.0