Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
foid025  
#1 Posted : Friday, September 29, 2006 3:33:31 AM(UTC)
foid025

Rank: Member

Groups: Member
Joined: 9/29/2006(UTC)
Posts: 2

Hi,
I am trying to setup Image Uploader on my website to see if it will fit my needs (demo so far) and I am having issues trying to upload files. Basically, the applet works fine (both in Java and ActiveX) and transfers to my action page (which is PHP), but it seems the $_POST variables are not initialized. Here is the code on my upload page:

Code:
			<script language="javascript">
					var iu = new ImageUploaderWriter("ImageUploader", 600, 450);
					
					// If you do not want to use ActiveX or Java version, set the appropriate
					// property to false.
					iu.activeXControlEnabled = true;
					iu.javaAppletEnabled = true;
					
					iu.activeXControlCodeBase = "Aurigma/ImageUploader4.cab";
					iu.javaAppletCodeBase="Aurigma/";
					
					
					// ... initialize params as described in the next topic ...
					iu.addParam("TreePaneWidth", "190");
					iu.addParam("AllowTreePaneWidthChange", "true");
					iu.addParam("AllowFolderUpload", "true");
					iu.addParam("FileMask", "*.txt;*.doc;*.pdf;*.ppt;*.rtf;*.rtx;*.xls;*.email;*.jpg;*.jpeg;*.jpe;*.gif;*.bmp;*.png");
					iu.addParam("MaxDescriptionTextLength", "400");
					iu.addParam("MaxTotalFileSize", "3000000000");
					iu.addParam("MessageMaxTotalFileSizeExceededText", "You are not allowed to upload more than 3GB at once.");
					iu.addParam("FilesPerOnePackageCount", "1");
					iu.addParam("AutoRecoverMaxTriesCount", "5");
					iu.addParam("AutoRecoverTimeOut", "5000");
					iu.addParam("FolderView", "Details");
					iu.addParam("Action", "mUploadAction.php?method=multiple");
					//iu.addParam("RedirectUrl", "members.php")
					iu.addParam("UploadSourceFile", "true");
					iu.addParam("ShowDebugWindow", "true");
					//iu.addParam("RedirectUrl", "mUploadAction.php?method=multiple")
					iu.writeHtml();
				</script>



And on my processing (action) page nothing happens. Some debugging seems to show that when I use the code:
Code:
    $fileCount = $_POST["FileCount"];
    echo $fileCount;

Nothing is printed. It would seem that the POST variables are not getting set. Here is a bigger excerp of my processing page:

Code:
		$fileCount = $_POST["FileCount"];
		echo "file count: " . $fileCount;
		//Iterate through uploaded data and save the original file and make the db entry
		for ($i = 1; $i <= 5; $i++)
		{
		    echo "
i: " . $i;
			//set variables
		    $sourceFileField = "SourceFile_" . $i;
			$name = $_FILES[$sourceFileField]["name"];
			$file = $_FILES[$sourceFileField]["tmp_name"];
		    $description = $_POST ['Description_' . $i];
		    
		    if($name == "")
			{
				$name = basename($_FILES['file']['name']);
				$ex = explode(".", $name);
				$name = $ex[0];
					$name = str_replace(" ", " ", $name );
					$name = str_replace("&", "-", $name );
					$name = str_replace("%", "-", $name );
					$name = str_replace(";;", "-", $name );
					$name = str_replace(";", "-", $name );
					$name = str_replace("?", "-", $name );
					$name = str_replace("@", "-", $name );
					$name = str_replace("'", "-", $name );
			}
		    echo $name . "
";
		    echo $file . "
";
		    echo $description . "
";
		    echo "

";
			$fid = addFile($name, $uemail, $uname, $security, $file, $description);		//upload file, return fid					
			if($fid != "-1")
				linkToUser($fid, $uid, $folder);
			else
				echo "<META HTTP-EQUIV='Refresh' CONTENT='0; URL=errors.php?code=00'>"; //redirect user on error
			
		}


Any idea on this issue? Thank you very much!

Otherwise great program...

Edited by user Wednesday, December 19, 2007 1:42:59 PM(UTC)  | Reason: Not specified

George Ulyanov  
#2 Posted : Sunday, October 1, 2006 5:47:35 PM(UTC)
George Ulyanov

Rank: Advanced Member

Groups: Member
Joined: 7/26/2006(UTC)
Posts: 203

Hello,

I have answered you by email.

Edited by user Friday, February 22, 2008 2:11:21 AM(UTC)  | Reason: Not specified

Best regards,
George Ulyanov
foid025  
#3 Posted : Monday, October 2, 2006 2:09:07 AM(UTC)
foid025

Rank: Member

Groups: Member
Joined: 9/29/2006(UTC)
Posts: 2

Thank you very much George. That solved that problem. I do have another like kink though: I need to check the MIME type of uploaded files to see what file type they are. I am doing this via $_FILES[$sourceFileField]['type']. For JPEG files I am correctly informed of a mime type "image/jpeg", but with MS Office files i get something like "application/octet-stream". By the way this is with the Active-X applet, not Java.

How do I go around this? It is quite important for me to be able to tell what file type files are... Thanks a lot!

Edited by user Friday, February 22, 2008 2:11:34 AM(UTC)  | Reason: Not specified

George Ulyanov  
#4 Posted : Monday, October 2, 2006 1:07:27 PM(UTC)
George Ulyanov

Rank: Advanced Member

Groups: Member
Joined: 7/26/2006(UTC)
Posts: 203

Hi,

Here is the list of supported MIME-types:

application/octet-stream
image/jpeg
image/bmp
image/png
image/tiff
image/pcx
image/gif
application/psd

For non-images files MIME-type is always "application/octet-stream".

Edited by user Friday, February 22, 2008 2:13:26 AM(UTC)  | Reason: Not specified

Best regards,
George Ulyanov
pwhitrow  
#5 Posted : Wednesday, July 25, 2012 3:40:16 AM(UTC)
pwhitrow

Rank: Newbie

Groups: Member
Joined: 7/25/2012(UTC)
Posts: 1

George Ulyanov wrote:
Hello,

I have answered you by email.



Could you perhaps share the solution here as I am having the same problem, no post data returned.

Thanks.
Dmitry.Obukhov  
#6 Posted : Wednesday, July 25, 2012 10:32:43 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Please submit a new support ticket describing your issue in details.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.