Powershell & Vb Script: upload & download file from a url with credentials

Hello experts,
I am looking for a script to :
-Upload file to an url
-Download specific and last modified file from a url
To access to this url I need to report credentials. User and password.
I heard about cUrl application however if this is possible through a build-in language such as powershell or vbscript I a prefer this approach.
As regards the upload and the download the script should manage success and error actions in a log file.
Thank you in advance for your feedback.
LVL 1
LD16Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
You do not have any way to check for "last modified file from a url" because you do not have any query interface by default.

Whether you can use credentials depends on the target site. If  it requires login thru a form, this can be done often (but not in all cases) by parsing the HTML response. Sometimes you can POST credentials.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LD16Author Commented:
Ok, thank you for your feedback.
Here is the command that I have to do it through cURL:
Export:
@echo off

rem Set curl path.
set CURL="curl/curl"

cd "C:\Test"

rem Set site url.
set SITE_URL=

rem Set login.
set LOGIN=

rem Set password.
set PASSWORD=

rem Set action url.
set ACTION_URL=%SITE_URL%/getLastFile/62

rem Set input file path and name.
set PARAM_PROXY=

set FILE="toto.txt"

rem Import the file.
curl -v -k %ACTION_URL% -u %LOGIN%:%PASSWORD% -o %FILE%

pause

Open in new window


Send:
@echo off

rem Set curl path.
set CURL="curl/curl"

cd "C:\Temp"

rem Set site url.
set SITE_URL=

rem Set login.
set LOGIN=

rem Set password.
set PASSWORD=

rem Set action url.
set ACTION_URL=%SITE_URL%/sendFile/51

rem Set input file path and name.
set PARAM_PROXY=

set FILE="file=@filename.csv"

rem Import the file.
curl -v -k %ACTION_URL% -u %LOGIN%:%PASSWORD% -F %FILE%

pause

Open in new window


How we can translate them to vbscript or powershell?
Thank you very much for your help.
LD16Author Commented:
I will use cURL as it works for me.
Thank you anyway for your help.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
If it is that simple with curl, I see no reason to change anything ;-).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.