Daniel H.
Karma: 0
|
automate the download of a file kept in remository - 2010/07/23 11:13
When I try to download a file from our website (which is using Joomla 1.5.15 with Remository 3.52.8) via powershell, an error occurs:
Exception: "the remote server returned an error: (403) forbidden."
The powershell script uses a .net webclient Object. Here's the code snippet:
$DownloadUrl = "http://mywebsite.com/remos/func-download/33/chk,db157b1c1ef7f7c8fee36d9bb462b97c/no_html,1/" $Filename = "c:TempTest.exe" $WebClient = New-Object System.net.WebClient $WebClient.Headers.Add("Cookie", $ie.Document.cookie) $WebClient.DownloadFile($DownloadUrl, $Filename)
If the URL (as specified in $DownloadUrl) is used manually in the Browser, the download starts and finishes without any problems.
I think the problem is, that the URL does not point to a file but to a remository function instead.
I will be thankful for any hint, how to download the file using powershell.
Post edited by: Daniel H., at: 2010/07/23 14:05
|