COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Prev Previous Post   Next Post Next
Old 07-15-2011, 12:59 PM   #1
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default upload filed check uploader settings

Ok I think I got the php file set up on my server, but I'm still getting this error, what do I check next?

here's my php file

<?php

/************************************************** *******
the custom uploader does a simple http post request to your url.
it expects the following return on error:

<upload><error>some error message here</error></upload>

it expects the following return on success:

<upload><url>http://someurlhere.com/blah.png</url></upload>

the xml return is whitespace-insensitive, so feel free to throw in
some newlines or whatever between tags if that be your thing.

remember, your script can do whatever it wants on the backend, but it MUST
use our return format. such is life.

daniel green / regis nebor
http://shup.com | http://stashbox.org
************************************************** ********/

$file_input_name = "file";
$my_local_path = dirname(__FILE__).'/filez/';
$my_web_root = "http://pipelineaudio.net/shup/files/";
$filename = "";
$error = "";

function do_xml()
{
global $my_web_root;
global $filename;
global $error;
header('Content-type: text/xml');
if ($error)
die("<upload><error>$error</error></upload>");

die("\r\n\r\n<upload><url>" . $my_web_root . $filename . "</url><filename>" . $filename . "</filename></upload>\r\n\r\n");
}

$error = "";

if (!$_FILES)
{
$error = "No data was submitted. Try checking your browser settings and retry your request.";
do_xml();
}

$file = $_FILES[$file_input_name];

if (!$file)
{
$error = "The file was not uploaded properly.";
do_xml();
}

$filename = basename($file["name"]);

if (!move_uploaded_file($file["tmp_name"], $my_local_path . $filename))
$error = "Error saving file to disk.";

do_xml();

?>
pipelineaudio is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.