PHP Classes

Parse Error

Recommend this page to a friend!

      AJAX File Uploader  >  All threads  >  Parse Error  >  (Un) Subscribe thread alerts  
Subject:Parse Error
Summary:Parse Error
Messages:6
Author:Logan Mabe
Date:2005-12-14 15:15:27
Update:2006-03-17 13:43:17
 

  1. Parse Error   Reply   Report abuse  
Picture of Logan Mabe Logan Mabe - 2005-12-14 15:15:27
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /var/www/html/intranet2/ajax5/AjaxFileUploader.inc.php on line 14

Fatal error: Cannot instantiate non-existent class: ajaxfileuploader in /var/www/html/intranet2/ajax5/index.php on line 15

  2. Re: Parse Error   Reply   Report abuse  
Picture of Lee Lee - 2005-12-14 17:43:30 - In reply to message 1 from Logan Mabe
use php4 ?

AjaxFileUploader.inc.php

@todo all the PHP 4.x users are requested to remove "PUBLIC", "PRIVATE" and "PROTECTED" keywords before the functions
@PHP 4.x users replace "PRIVATE" from the following lines with VAR

  3. Re: Parse Error   Reply   Report abuse  
Picture of Logan Mabe Logan Mabe - 2005-12-15 14:42:14 - In reply to message 2 from Lee
This was super helpful. I can now load the page without any errors, however when I browse for a file and select open, the page appears to try to upload or something... kindof does a refresh but does not upload or return any error message. and yes, my folders are fuly open for read/write/etc...

  4. Re: Parse Error   Reply   Report abuse  
Picture of Kenneth Watson Kenneth Watson - 2005-12-18 15:30:46 - In reply to message 3 from Logan Mabe
The problem is this script will only work on local files, where the local web server has access to the local path of the file you're trying to upload.

Uploading the file "C:\Somefile.txt" will simply do a file copy from there to wherever your www root is (and the upload subdirectory set).

It's more of a local file copier than an actual uploader.

  5. Re: Parse Error   Reply   Report abuse  
Picture of Jeff Paffett Jeff Paffett - 2006-01-03 13:53:20 - In reply to message 4 from Kenneth Watson
It's actually very misleading to call this class a file uploader. It's actually not possible to upload files using AJAX.

  6. Re: Parse Error   Reply   Report abuse  
Picture of Sergey Shilko Sergey Shilko - 2006-03-17 13:43:17 - In reply to message 5 from Jeff Paffett
It simply submits form by :

if(browser == "Microsoft Internet Explorer"){
obj = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
obj = new XMLHttpRequest();
}
return obj;

working fine..