?
Solved

JQuery/AjaxFileUpload: how do i transmit custom parameter to server

Posted on 2011-10-05
2
Medium Priority
?
1,380 Views
Last Modified: 2012-05-12
hello all,

the jquery plugin AjaxFileUpload works fine in my project.  I mean the codes from here works:

http://www.phpletter.com/Our-Projects/AjaxFileUpload/

the problem is, i would like to transmit more parameter to server, for example, each time when the codes run, i would like to send the value of Id to server.

the original Codes are attached here.  I have tried to add a new line there:

data: {id='1'},

but it seems not be sended to server.

any suggestion about how to send it to server and then read it from server?

thanks,

wantime


url:'doajaxfileupload.php',
                secureuri:false,
                fileElementId:'fileToUpload',
                dataType: 'json',
                success: function (data, status)

Open in new window

0
Comment
Question by:wantime
2 Comments
 
LVL 5

Accepted Solution

by:
hax1 earned 2000 total points
ID: 36917180
url:'doajaxfileupload.php?id=1',
                secureuri:false,
                fileElementId:'fileToUpload',
                dataType: 'json',
                success: function (data, status)

would be one way to do it ...

use $_GET['id'] to access the variable from doajaxfileupload.php ... and be sure to validate that it's a number, so nobody can inject arbitrary code.
0
 

Author Closing Comment

by:wantime
ID: 36917226
correct.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question