473,785 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hidden variables with EncType="multip art/form-data"

30 New Member
Not able to pass variables data:

Hello .. Im building a form that uploads files with encType="multip art/form-data" but on the same form I need to pass other variables with hidden fields.

The files are uploading fine but Im not getting the values of the hidden fields,

How can I get hidden field values along with uploaded files in the same form..??

This is my form code:


Expand|Select|Wrap|Line Numbers
  1. <form action="upload_file.pl" encType="multipart/form-data" method="Post">
  2. <input type=file name="FILE">
  3. <input type="hidden" name="URL" value="$URL">
  4. <input type="hidden" name="Alias" value="$Alias">
  5. <INPUT type=submit value="Upload File">
  6. </form>
Im attaching the perl script that handles the upload under the name of Upload_Perl_Scr ipt.txt

Thanx beforehand
Virtual Web
Attached Files
File Type: txt Upload_Perl_Script.txt (11.9 KB, 748 views)
Jul 26 '09 #1
4 6131
numberwhun
3,509 Recognized Expert Moderator Specialist
@virtualweb
I see your above form code and I have a question. Is that code being sent to the browser by a Perl script, or is it just an HTML file? If it is a Perl script, can we see it as well?

If they are not set, then I assume there is an issue with your variables being set as shown above and you should look into that first to ensure they are being set.

Regards,

Jeff
Jul 26 '09 #2
KevinADC
4,059 Recognized Expert Specialist
That script is written to get only numbered file upload fields. How are you getting $URL and $ALIAS into that form you posted anyway?
Jul 26 '09 #3
KevinADC
4,059 Recognized Expert Specialist
assuming your form is populated correctly:

change this:

Expand|Select|Wrap|Line Numbers
  1.     use CGI; 
  2.  
  3.     $max_num_files  ||= 1;
  4.     $Data         ||= $ENV{'DOCUMENT_ROOT'};
  5.     undef @bad_extensions if @good_extensions;
change to:

Expand|Select|Wrap|Line Numbers
  1.     use CGI; 
  2.  
  3.     $max_num_files  ||= 1;
  4.     $Data         ||= $ENV{'DOCUMENT_ROOT'};
  5.     undef @bad_extensions if @good_extensions;
  6.     $alias = $req->param("Alias");
  7.     $url = $req->param("URL");
  8.  
now you use $url and $alias in the perl script however you need them.
Jul 26 '09 #4
virtualweb
30 New Member
Hi KevinADC:

I appreciate your help.. I had tryed your solution prior to posting for help here, and it didnt work. This made me think that uploading a file was different than passing text as a variable.

Second time around worked just fine..

Thanx a million
VirtualWeb
Jul 26 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1449
by: Ken Shaw Jnr | last post by:
Hi, I'm just wondering if anyone knows why when using links of the form <a href="/gsv/net....."> session variables are reset? Is there any way around this? cheers, Ken
3
3350
by: Erik T. Nomad | last post by:
I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm wondering if there's a way to customize it further, such that the hyperlink they are sent is the web address of the page the "send to friend" link was on. I don't want to convert my entire site over to .asp, so having a pop-up .asp page seems to make...
5
8486
by: Quinn | last post by:
When users clicked a unkown mime type link such as Zip on my website, a "Save/Open/Cancel" dialog box pops up. Is there a way to detect which button users clicked by using ASP? actually I only what to record the "valid" click -- when Open/Save was clicked. Thanks ahead. Quinn
2
16349
by: Alex | last post by:
Hello, I use the following script inside a page. My page contains : 1 FORM, Some Hidden fields, and one line of JAVASCRIPT in order to instantly post the Form. The problem is that under FIREFOX, the JAVASCRIPT line don't seems to be correct, because FIREFOX does'nt post the Form... But my javascript line looks correct to me... Below is the Script; thanks for your Help in advance.
21
66849
by: strutsng | last post by:
<input type="file"> only allows the user to browse for files. How about "browse for folder" dialog? Can html/javascript do that? I couldn't find any syntax for that. If not, please advise what are the other approaches. please advise. thanks!!
2
1823
by: tlyczko | last post by:
Hello, Doug Steele, Microsoft Access MVP, has commented: "See whether the sample application "At Your Survey" which Duane Hookom has at http://www.rogersaccesslibrary.com/duanehookom/duanehookom.htm gives you what you need." I wonder if anyone who has used this little app could advise me upon adapting this app to work successfully to administer a survey that has
5
4587
by: Jeff | last post by:
Visual Studio 2003 DotNet framework 1.1 Windows 2000 Pro I create two pages in an Asp.net application, one is html page with a form in it: .... <form id="testForm" method="post" action="test.aspx" runat="server"> <input type="hidden" id="hiddenTest" value="hello, world"> <input type="submit" id="btnSubmit" value="submit">
23
3651
by: lwoods | last post by:
I am trying to pass some info to another page on my site. I set "session_start()" in page 1, assign a session variable to a value, then execute a "header('Location: ....')." But on the target page I don't get any session variable values! BTW, I used a relative location in the Location header, not an absolute URL. The behavior looks like it started another session, but it should not have. Ideas? TIA,
25
2885
by: william.hooper | last post by:
here is my form: <html> <head></head> <body> <FORM ACTION="code.php" method="post"> <INPUT TYPE=SUBMIT NAME="arty.jpg" VALUE="Action"> </FORM>
3
2437
by: MrCorbeaux | last post by:
My "Email a Webpage" form works find except when the end user receives the email, the URL is text only and not a hyperlink. The "Email a Page" form calls the URL from the previous page using: <input type="hidden" name="URL" value="<%= Request.ServerVariables("HTTP_REFERER")%>"> The action page uses CDOsys to send the email: My abridged code: <%@LANGUAGE="VBSCRIPT"%> <% strFrom = Request.Form("FromEmail") strFromName =...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.