Forums

PHP

This topic is locked

Pure PHP Upload not uploading

Posted 15 Feb 2007 15:03:41
1
has voted
15 Feb 2007 15:03:41 Steven 72hrprint posted:
I just purchased and installed Pure PHP Uploader extension to dreamweaver 8. I created a simple upload form and added the PPU code with a progress bar. Here is the code...

{php]
<script language='javascript' src='ScriptLibrary/incPureUpload.js'></script>
<?php require_once('ScriptLibrary/incPureUpload.php'); ?>
<?php
// Pure PHP Upload 2.1.3
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu = new pureFileUpload();
$ppu->path = "/upload/";
$ppu->extensions = "";
$ppu->formName = "fileupload";
$ppu->storeType = "file";
$ppu->sizeLimit = "";
$ppu->nameConflict = "over";
$ppu->requireUpload = "true";
$ppu->minWidth = "";
$ppu->minHeight = "";
$ppu->maxWidth = "";
$ppu->maxHeight = "";
$ppu->saveWidth = "";
$ppu->saveHeight = "";
$ppu->timeout = "600";
$ppu->progressBar = "fileCopyProgress.htm";
$ppu->progressWidth = "300";
$ppu->progressHeight = "100";
$ppu->checkVersion("2.1.3";
$ppu->doUpload();

$uploadGoTo = "index.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$uploadGoTo .= (strpos($uploadGoTo, '?')) ? "&" : "?";
$uploadGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $uploadGoTo));
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true";
} else {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
}
} else {
$GP_uploadAction .= "?"."GP_upload=true";
}

if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
?><form action="<?php echo $GP_uploadAction; ?>" method="post" enctype="multipart/form-data" name="fileupload" onsubmit="checkFileUpload(this,'',true,'','','','','','','');showProgressWindow('fileCopyProgress.htm',300,100);return document.MM_returnValue">
<label>Project files
<input name="file" type="file" onchange="checkOneFileUpload(this,'',true,'','','','','','','')" />
</label>
<input type="submit" name="Submit" value="Submit" />

</form>
[/php]

As per the instructions I changed the permissions on our Windows 2003 server for Internet Guest Account for the /Upload directory....

However, when I submit a file the progress bar shows up but the site doesn't redirect and the file does not upload. Any idea what could be stoping it?

Thanks

Replies

Replied 15 Feb 2007 15:14:20
15 Feb 2007 15:14:20 Steven 72hrprint replied:
I tested this simple php upload code and file was able to upload

[php]
/*** Php File Upload Test Script ***/
$target_path = "upload/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
[/php]

So I know that permissions are set properly. It has to be something in the Pure Php Uploader Code...

Reply to this topic