Page 1 of 1
Using php to upload files to remote WEBdav server
Posted: Wed Jul 09, 2008 9:18 am
by akronymn
I am currently building a site that is hosted on one server but contains links to videos hosted on a remote server. I want to allow users to upload videos which my script will move to the remote server. The remote server requires authentication. This is the first time I have done anything like this so I'm not even sure where to begin. The remote server has an address starting with http:// so I'm guessing I'll have to transfer the videos via http. Some basic info is below but I'll be more than happy to provide any other info that would help me get moving. Thanks!
local server: apache 2.0.63.200
local OS : WINNT
PHP version: 4.3.11
remote server: WEBDav
Re: Using php to upload files to remote WEBdav server
Posted: Wed Jul 09, 2008 3:56 pm
by maliskoleather
Re: Using php to upload files to remote WEBdav server
Posted: Wed Jul 09, 2008 4:02 pm
by Benjamin
There are numerous ways to do this, but posting video files to a remote server doesn't make the short list.
I'd probably go with FTP for FISH for something like this.
Here's a start:
http://us2.php.net/manual/en/book.ftp.php
Re: Using php to upload files to remote WEBdav server
Posted: Thu Jul 10, 2008 10:08 am
by akronymn
OK so I've made some progress using HTTP_WebDAV_client but I've hit another wall. Here is the gist of my code:
stream_register_wrapper("webdav", "HTTP_WebDAV_Client_Stream");
$src_vid_path ="c:\\apache\\htdocs\\tempVideos\\";
$target_vid_path = 'webdav://*****.com/WMRoot/ce/'.$full_tid.'.wvx';
$src = fopen($tmp_vid_path, "rb");
$tgt = fopen($target_vid_path, "wb");
rename($src, $tgt);
I've checked and rechecked that my URL's are correct and that the source video is actually where it should be. Here is the error I get though:
Warning: fopen(webdav://...@stream.mediascape.com/WMRoot/ce/M102722_1cd7_1ce6.wvx): failed to open stream: "http_webdav_client_stream::stream_open" call failed in C:\apache\htdocs\uploader.php on line 53
Warning: rename(Resource id #25,): No such file or directory in C:\apache\htdocs\uploader.php on line 58
Thanks for the help!