473,396 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Store Temporary Vale Help

Newbie ASP Question.
I hope this is the right place to ask.
I have an ASP Upload element that I need help with.
This is the problem
I have 2 fields Image and FileName (FileName isnt the name of Image in this
case)

From page 1 I sudmit the 2 fields of info to the Upload Page.
The info arrives ok at the upload page.
I browse and select the file and hit submit...
The info for the Image arrives at destination but the FileName field does
not.
Heres the code I have...

<%
Dim MyFile
MyFile = Request("Name")

if UCase(Request.ServerVariables("HTTP_METHOD"))="POS T" Then
Set fu = Server.CreateObject("AspUtil.FileUpload")
fu.directory = Server.MapPath(".")
rc = fu.Upload
If rc = 0 then
For n=0 to fu.count-1
set item = fu.item(n)
Response.Write "FileName: " & item.filename & "<BR>"
Response.Write "Bytes written: " & item.Size & "<BR>"
item.Save
Next

Else
Response.Write "File upload failed. RC: " & rc & "<BR>"
End If
response.redirect "http://dmsproxy/adm/products/add_image.asp?NewImage=" &
item.filename & "&FileName=" & MyFile
Else
%>
<form method=post ENCTYPE="multipart/form-data" action="upload_image.asp">
<font size="2">&nbsp; Image</font><input type=file name=Image size="20"
value="<%=Request("Image")%>"><br>
&nbsp;Name<input type="text" name="Name" size="20"
value="<%=Request("Name")%>"><br>
<br>
<input type=submit></form>
<%
end If
%>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
Jul 19 '05 #1
2 2276
You' have to use the upload component to retrieve form field values. I
don't know that component, but it my something along the lines of:

sTheTextInput = fu.form.item("Name")

Look at the documentation for the component for how to retrieve normal form
field values.

Ray at work
"Tim James" <NO*****************@yahoo.com> wrote in message
news:e7****************@TK2MSFTNGP12.phx.gbl...
Newbie ASP Question.
I hope this is the right place to ask.
I have an ASP Upload element that I need help with.
This is the problem
I have 2 fields Image and FileName (FileName isnt the name of Image in this case)

From page 1 I sudmit the 2 fields of info to the Upload Page.
The info arrives ok at the upload page.
I browse and select the file and hit submit...
The info for the Image arrives at destination but the FileName field does
not.
Heres the code I have...

<%
Dim MyFile
MyFile = Request("Name")

if UCase(Request.ServerVariables("HTTP_METHOD"))="POS T" Then
Set fu = Server.CreateObject("AspUtil.FileUpload")
fu.directory = Server.MapPath(".")
rc = fu.Upload
If rc = 0 then
For n=0 to fu.count-1
set item = fu.item(n)
Response.Write "FileName: " & item.filename & "<BR>"
Response.Write "Bytes written: " & item.Size & "<BR>"
item.Save
Next

Else
Response.Write "File upload failed. RC: " & rc & "<BR>"
End If
response.redirect "http://dmsproxy/adm/products/add_image.asp?NewImage=" &
item.filename & "&FileName=" & MyFile
Else
%>
<form method=post ENCTYPE="multipart/form-data" action="upload_image.asp">
<font size="2">&nbsp; Image</font><input type=file name=Image size="20"
value="<%=Request("Image")%>"><br>
&nbsp;Name<input type="text" name="Name" size="20"
value="<%=Request("Name")%>"><br>
<br>
<input type=submit></form>
<%
end If
%>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003

Jul 19 '05 #2
Thanks for the speedy reply Ray.
This is an old component that I have zipped up and I dont even know the
author. I has no documentation with it.
I will have to google it and see what I can find out...
Thanks again
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:#1**************@TK2MSFTNGP11.phx.gbl...
You' have to use the upload component to retrieve form field values. I
don't know that component, but it my something along the lines of:

sTheTextInput = fu.form.item("Name")

Look at the documentation for the component for how to retrieve normal form field values.

Ray at work
"Tim James" <NO*****************@yahoo.com> wrote in message
news:e7****************@TK2MSFTNGP12.phx.gbl...
Newbie ASP Question.
I hope this is the right place to ask.
I have an ASP Upload element that I need help with.
This is the problem
I have 2 fields Image and FileName (FileName isnt the name of Image in

this
case)

From page 1 I sudmit the 2 fields of info to the Upload Page.
The info arrives ok at the upload page.
I browse and select the file and hit submit...
The info for the Image arrives at destination but the FileName field does not.
Heres the code I have...

<%
Dim MyFile
MyFile = Request("Name")

if UCase(Request.ServerVariables("HTTP_METHOD"))="POS T" Then
Set fu = Server.CreateObject("AspUtil.FileUpload")
fu.directory = Server.MapPath(".")
rc = fu.Upload
If rc = 0 then
For n=0 to fu.count-1
set item = fu.item(n)
Response.Write "FileName: " & item.filename & "<BR>"
Response.Write "Bytes written: " & item.Size & "<BR>"
item.Save
Next

Else
Response.Write "File upload failed. RC: " & rc & "<BR>"
End If
response.redirect "http://dmsproxy/adm/products/add_image.asp?NewImage=" & item.filename & "&FileName=" & MyFile
Else
%>
<form method=post ENCTYPE="multipart/form-data" action="upload_image.asp"> <font size="2">&nbsp; Image</font><input type=file name=Image size="20"
value="<%=Request("Image")%>"><br>
&nbsp;Name<input type="text" name="Name" size="20"
value="<%=Request("Name")%>"><br>
<br>
<input type=submit></form>
<%
end If
%>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Didier ROS | last post by:
Hi, I am a newbie I want to create a temporary table and I get the following error message : mysql> CREATE TEMPORARY TABLE tempemp AS SELECT * FROM emp; ERROR 1044: Access denied for user:...
5
by: White Wolf | last post by:
Hi, I would like to double check how long a temporary returned by a function lives? Suppose I have an instance of a class type C, which has a member function returning some sort of...
2
by: Keith Watson | last post by:
Hi, we are currently implementing an application running on DB2 V7 on Z/OS using largely COBOL stored procedures, managed using WLM. Some of these stored procedures declared global temporary...
2
by: Brian O'Haire | last post by:
Any help would be appreciated: I have a routine on an asp.net web page, This code below point to a text box called lbtable. public void GetTables( ) { //string TblDName = new string;...
1
by: James T. | last post by:
Hello! I am developing a travel agency web site. Now I am bit stuck and need some advice. I created a 4 step wizard page to add new vacation package to the database. On the 3rd step there is...
18
by: siddharthkhare | last post by:
Hi All, what is the diference between these two cache control header. no-cache and no-store. I have read the w3.org explanation. So lets say I am using only no-cache ....my understanding is...
10
by: Jess | last post by:
Hello, If I create a temporary object using a dynamically created object's pointer, then when the temporary object is destroyed, will the dynamically created object be destroyed too? My guess...
0
by: sgueder | last post by:
Hi there, hope anybody can help me: I want to create a temporary table, want to fill that table with data and finally I want to use that table as my base-table for running some selects on it...
8
by: pim | last post by:
Dear All, What I was wondering is how safe it is to store user_id or username or anything like that in session. I usualy store a bunch of info in a session so I do not need to search the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.