Sign in to follow this  
Followers 0
igrok

Copy File To Web Folder?

7 posts in this topic

#1 ·  Posted (edited)

Any way to copy a file from the filesystem to a webfolder (sometimes called webDAV)?

I'd like to do that via a command line. With FileCopy it does not seem to work

FileCopy("C:\somedir\*.htm", "http://aa.bb.com/dan/")

Copying via explorer works fine, but I want to have this copy run every day by a automated (scheduled) task.

Any idea?

By the way, dos copy and otehr copy programs, like robicopy will not work.

Thanks

Dan

Edited by igrok

Share this post


Link to post
Share on other sites



Thanks, JdeB. Unfortunately, that won't work. CURL is able to POST and to PUT. My http server does not allow this in the directory I am using. However, the directory on the server is open for WebDAV or web folder...

It was worth a try. Neat utility this curl. I will keep it. Although it does not work for this case.

Dan

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It seems that you can use the command net use to map a drive to a web address

Net Use x: http://www.webaddress.com/foldername

After doing that you could then use the FileCopy command

You could even include the net use to connect and disconnect in the script if you didn't want to leave the mapped drive connected all the time.

Edited by psichosis

We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Oh. That would be elegant.

Unfortunately, this does not work on my machine. I get the following error:

System error 67 has occurred.

The network name cannot be found.

I see from the manual that it actuall should work. The fast response of the system, getting me the error, indicates that I have probably a name resolving issue...

I will check..

great hint!

Dan

Edited by igrok

Share this post


Link to post
Share on other sites

Instead of the actuall web address, you could use the IP address

Net Use x: http://155.108.65.34/foldername

*NOTE* Not an actual IP Address ... just one off the top of my head


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

I think I have another problem.

The commandline returns just too fast with the error 67. I started a sniffer (ethereal) to check on network traffic caused by the command net use x: http://... and guess what..

There is no traffic at all!

(also not with an IP address)

Repeating net use with any normal UNC (\\server\...) shows notable traffic. And the mapping works.

Thus I guess my implementation of Webfolders or webDAV is buggy. I am running Windows XP SP1 and the .NET stuff is installed. According to Microsoft, the WebDAV redirector should work with plain Windows XP.

The WebClient service is running fine. And as I said previously, drag and drop over explorer works fine to and from a webfolder..

Strange setup I seem to have. :-(

Dan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0