Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP WebDAV Upload #1

Open
emresaracoglu opened this issue Mar 21, 2017 · 1 comment
Open

PHP WebDAV Upload #1

emresaracoglu opened this issue Mar 21, 2017 · 1 comment

Comments

@emresaracoglu
Copy link

emresaracoglu commented Mar 21, 2017

Hello

I use phpEasyVCS v2 but I want to upload files with PHP

I have tried CURL but not working for me

    $file_path_str = 'Example.png';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://dav.mysite.com:443/webdav.php' . basename($file_path_str));
    curl_setopt($ch, CURLOPT_USERPWD, "myUsername:myPassword");
    curl_setopt($ch, CURLOPT_PUT, 1);

    $fh_res = fopen($file_path_str, 'r');

    curl_setopt($ch, CURLOPT_INFILE, $fh_res);
    curl_setopt($ch, CURLOPT_INFILESIZE, filesize($file_path_str));

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE);

    $curl_response_res = curl_exec ($ch);
    fclose($fh_res);

Can you help with this?
My server:
Nginx 1.9 - PHP 7.0 - SSL

@emresaracoglu
Copy link
Author

by the way, I searched you on the internet. I've seen plugins that you've developed for GetSimple and I still use your add-ons for at least 4 years :) This is a very interesting encounter for me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant