473,395 Members | 1,692 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,395 software developers and data experts.

preview problem

I have a form that sends data on to another page so that the user can
preview it before it is inserted in a database table.

The problem is that the form sends both text and possibly an image to
the page used for preview. Even if I use a hidden input field for the
image file it still is displayed on the text centric page but with
enctype for foo bars the image into gibberish that fills a large part of
the preview page.

How can I pass the image on to the preview page without it being
"displayed"? (Image is validated later).
/M.
Jul 17 '05 #1
3 1901
In article <6r********************@newsb.telia.net>,
Martin S <ma****@skjoldebrand.org> wrote:
I have a form that sends data on to another page so that the user can
preview it before it is inserted in a database table.

The problem is that the form sends both text and possibly an image to
the page used for preview. Even if I use a hidden input field for the
image file it still is displayed on the text centric page but with
enctype for foo bars the image into gibberish that fills a large part of
the preview page.

How can I pass the image on to the preview page without it being
"displayed"? (Image is validated later).
/M.


Store it in a temp directory on the server, and pass on a reference to
the image in a hidden variable to the preview page?

Just the first thing that comes to mind.

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #2
Regarding this well-known quote, often attributed to Martin S's famous
"Fri, 16 Apr 2004 05:46:42 GMT" speech:
I have a form that sends data on to another page so that the user can
preview it before it is inserted in a database table.

The problem is that the form sends both text and possibly an image to
the page used for preview. Even if I use a hidden input field for the
image file it still is displayed on the text centric page but with
enctype for foo bars the image into gibberish that fills a large part of
the preview page.

How can I pass the image on to the preview page without it being
"displayed"? (Image is validated later).
/M.


You can't put an image inline into HTML code. You have to save it somewhere
on the server, and make an <IMG SRC=""> tag, and possibly a hidden value or
session variable so the app knows where to find the image if the submission
is acceptable.

Remember: Never trust the user. Make sure that image is an image file
before you display it. You don't want your site "displaying" a .php file
they uploaded as an image.

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #3
In article <1e****************************@40tude.net>, FLEB wrote:
Remember: Never trust the user. Make sure that image is an image file
before you display it. You don't want your site "displaying" a .php file
they uploaded as an image.


Remember that only looking at the extension of a file is not a good idea
either.

--
http://home.mysth.be/~timvw
Jul 17 '05 #4

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

Similar topics

4
by: miarte | last post by:
I have a form to allow the user upload images. The user browse for an image in their computer and click open, th image to be upload is preview on the img tag. The script works fine with IE, but...
16
by: Neo Geshel | last post by:
I'm helping on a web site, and it's got our knickers in a knot. We're using the same basic CSS files (with mods) and same headers as from our other sites, but the "print preview" won't work...
7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
1
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is...
0
by: John | last post by:
I have a class that creates an AxWebBrowser object in the background, loads some arbitrary html content, then shows the user a print preview. The only problem is, this print preview is a tiny...
0
by: Shawn Mehaffie | last post by:
I am creatign a screen saver and am having a problem with showing the screensaver form in the preview pane. The code works correctly in the the form does display within the preview window. I created...
3
by: Jim S. | last post by:
ok, am trying to do a picture preview before i upload a picture, but i have a tiny problem , it used to work but, not anymore. here is the partial code (u do not need more to find the problem):...
12
by: mvsguy | last post by:
I'm an Access noob and apologize if I'm asking a stupid question. The problem is that I'm unable to design/preview reports on a database. How do I go about fixing this? Background - A user has...
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
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...

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.