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

Notification

Icon
Error

Options
Go to last post Go to first unread
jskita  
#1 Posted : Saturday, February 9, 2008 7:33:01 AM(UTC)
jskita

Rank: Newbie

Groups: Member
Joined: 2/1/2008(UTC)
Posts: 5

Hi .... I need to pass additional POSTed variables. This happens without a problem using IE and the Activex version but it doesn't work in Firefox.

ImageUploader Dual 5.0.30.0

Code:

function beforeUploadHandler() {
		 getImageUploader("ImageUploader1").AddField('uid', 'Jerry');
		 getImageUploader("ImageUploader1").AddField('album_id','8');
}

.....

iu.addEventListener("BeforeUpload", "beforeUploadHandler");		


The fields "uid" and "album_id" are passed when I use IE. Nothing gets passed when I use Firefox.

Anyone have any ideas.

Thanks, Jerry
jskita  
#2 Posted : Saturday, February 9, 2008 12:14:23 PM(UTC)
jskita

Rank: Newbie

Groups: Member
Joined: 2/1/2008(UTC)
Posts: 5

I was able to use another method to accomplish the same thing. I just added the parameters to the target URL.

Code:

iu.addParam("Action", "http://www.mydomain.com?uid=Jerry&album_id=8")


Works using both IE (Activex) and Firefox (Java). Not what I originally wanted to do but I can live with this.

Jerry
George Ulyanov  
#3 Posted : Sunday, February 10, 2008 1:48:56 PM(UTC)
George Ulyanov

Rank: Advanced Member

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

Hello Jerry,

I've used a simple script with the uploader's settings and the following upload processing code:

Code:

<%@ Page Language="vb" autoeventwireup="false" Debug="true"%>
<%@ Import Namespace="System.IO" %>

<script runat="server">
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
	Request.SaveAs(Server.MapPath("Dumps/NewDump_" & Request.Form("PackageGuid") & "_" & Request.Form("PackageIndex") & ".txt"),true)
    End Sub
</script>


It generates me the following POST fields:

Code:

Content-Disposition: form-data; name="uid"
Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

Jerry
--S6-64Xz6hwvnfFK3_--IqA5zxscP-PGn3CPNBDdH
Content-Disposition: form-data; name="album_id"
Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

8
--S6-64Xz6hwvnfFK3_--IqA5zxscP-PGn3CPNBDdH


I think the problem with POST fields is somewhere on the server side. Could you post your upload processing server-side code?

Edited by user Wednesday, February 13, 2008 5:04:47 PM(UTC)  | Reason: Not specified

Best regards,
George Ulyanov
jskita  
#4 Posted : Monday, February 11, 2008 4:42:29 AM(UTC)
jskita

Rank: Newbie

Groups: Member
Joined: 2/1/2008(UTC)
Posts: 5

George,

I created a simple upload script against the following code just as you did:

Code:
function beforeUploadHandler() {
         getImageUploader("ImageUploader1").AddField('uid', 'Jerry');
         getImageUploader("ImageUploader1").AddField('album_id','8');
}

.....

iu.addEventListener("BeforeUpload", "beforeUploadHandler");    


It worked just fine in both the Java and Activex version. Your assertion that the original issue was with the server side script is correct. I use cakePHP as my development framework and I perhaps don't completely understand how it accepts POST'd variables.

The onus is on me to figure that out.

In the meantime I'll use the workaround I had posted earlier and figure out what was wrong with my original script.

Thanks for your prompt reply.

Jerry

Edited by user Tuesday, February 26, 2008 6:57:07 PM(UTC)  | Reason: Not specified

Users browsing this topic
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.