sidwelle
asked on
powershell $webclient.UploadFileWithUniqueName
I am getting an error when I try to use the "Unique..." function of the $webclient in Powershell.
the "$webclient.UploadFile(... " seems to work fine, but I get an error with the Unique method:
Method invocation failed because [System.Net.WebClient] doesn't contain a method named 'UploadFileWithUniqueName' .
$MS docs state that it is there: Here
get-Host returns:
Name : Windows PowerShell ISE Host
Version : 3.0
thanks
the "$webclient.UploadFile(...
Method invocation failed because [System.Net.WebClient] doesn't contain a method named 'UploadFileWithUniqueName'
$MS docs state that it is there: Here
get-Host returns:
Name : Windows PowerShell ISE Host
Version : 3.0
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nope. The ftp client is for ftp connections only.
Powershell FTP upload and download
http://www.thomasmaurer.ch/2010/11/powershell-ftp-upload-and-download/
Powershell FTP upload and download
http://www.thomasmaurer.ch/2010/11/powershell-ftp-upload-and-download/
ASKER
I am amazed at how fast you post these examples !
I have seen that example before and wondered if they was labeled wrong ?
This top box has a header of "download", but the example in the box is an "upload" example ?
Trying to find am example that does not go through all that code of creating a file, just "Upload" or "Upload... Unique"
I see the that the "WebRequestMethods.Ftp" class has that method, now I Just need to figure out how to use it.
I have seen that example before and wondered if they was labeled wrong ?
This top box has a header of "download", but the example in the box is an "upload" example ?
Trying to find am example that does not go through all that code of creating a file, just "Upload" or "Upload... Unique"
I see the that the "WebRequestMethods.Ftp" class has that method, now I Just need to figure out how to use it.
Yes, seems like Upload and Download labels are just swapped.
ASKER
Thanks for your help, I found that project went a different direction and I don't need the Unique feature anymore. but what I did think about was that a better way would be to read the remove dir and chk your file name against it, and if it did already exist, rename it on you side first.
then, after transfer and you put your file into archive. you now have traceable filenames to work with.
Again thanks
then, after transfer and you put your file into archive. you now have traceable filenames to work with.
Again thanks
ASKER