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

Upload file from path #3

Closed
CIRCLE73 opened this issue Jun 4, 2014 · 1 comment
Closed

Upload file from path #3

CIRCLE73 opened this issue Jun 4, 2014 · 1 comment

Comments

@CIRCLE73
Copy link

CIRCLE73 commented Jun 4, 2014

PHP 5.4.27
Is it possible to upload a video file from an existing path instead of having the file in the same folder as the class?
Ex:

$process-> upload("../app_videos/oc_black(1).mp4", "webm" );

Or:

$process-> upload("http://www.domain.com/app_videos/oc_black(1).mp4", "webm" );

Full code:

$apikey="(...my_key...)";
$process = CloudConvert::createProcess("mp4", "webm", $apikey);
$process-> upload("../app_videos/oc_black(1).mp4", "webm" );

if ($process-> waitForConversion()) {
    echo "success";
} else {
    echo "failure";
}

I've tried each one and get this error:
Fatal error: Uncaught exception 'Exception' with message 'couldn't open file "../app_videos/oc_black(1).mp4"' in /(...)/CloudConvert.class.php on line 200

Thank you

@josiasmontag
Copy link
Contributor

Hi,

It should work - we are just passing the input file path to curl. Your error looks like that the file does not exist or the permissions might be wrong. Does file_exists("../app_videos/oc_black(1).mp4") work?

You could also try:

$process-> upload("/full/path/to/app_videos/oc_black(1).mp4", "webm" );

The second possibility is to upload by url, therefor you need the uploadByUrl() method:

$process-> uploadByUrl("http://www.domain.com/app_videos/oc_black(1).mp4", "oc_black(1).mp4", "webm" );

Please let me know if this solves your problem.

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

2 participants