Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4520 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hello ...

Trying to integrate SuperContainer with Uploadify. My method keeps dieing on the upload function. I have integrated the upload steps into the uploadify.php page ...Getting a 500 error in the popup generated by Uploadify. The file uploads via Uploadify, but the supercontainer upload fails. Here is the code ...

$targetFolder = '/client/files'; // Relative to the root

if (!empty($_FILES)) {

$tempFile = $_FILES['Filedata']['tmp_name'];

$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;

$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];

// Validate the file type

$fileTypes = array('jpg','jpeg','gif','png'); // File extensions

$fileParts = pathinfo($_FILES['Filedata']['name']);

if (in_array($fileParts['extension'],$fileTypes)) {

move_uploaded_file($tempFile,$targetFile);

// SUPERCONTAINER

include('sc/supercontainer.php');

$SC_BASE_URL = 'http://www.server.com/SuperContainer/Files';

$sc = new SuperContainer($SC_BASE_URL);

if ($sc->getError()) die('Could not connect to SuperContainer server: ' . $sc->getError());

$folderPath = "uploads/done";

$uploadedFile = "C:\\inetpub\\wwwroot\\client\\files\\" . $_FILES['Filedata']['name'];

$sc->upload($folderPath, $uploadedFile) or die("Could not upload $uploadedFile to $folderPath: " . $sc->getError());

//END SUPERCONTAINER

echo $uploadedFile;

} else {

echo 'Invalid file type.';

}

}

If anyone has attempted this and has a workable methodology, I'd greatly appreciate some insight! Thanks.

This topic is 4520 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.