473,626 Members | 3,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1917
In article <6r************ ********@newsb. telia.net>,
Martin S <ma****@skjolde brand.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.ev il.ones.will.bo w-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
32230
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 does not work with mozilla Netscap bowsers. Does anyone knows what could be the problem? Does the ONchange function works in Netscape? Or anyone knows a tag that can preview the image file before uploadin it.
16
11429
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 correctly on this site. The site is here: http://askdrray.kabis.net (temporary location) The site is being worked on, and only the front page works right now. Expect constant changes. Ignore everything “below the fold”, as the links there...
7
14358
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 display the graph but it is not possible to send query parameters to an OLE graph on a report (or programatically change any properties of an OLE Graph). However with a Form you do have the ability to change the RowSource of
1
2604
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 viewed in print preview mode by clicking the print preview button, and later closed by clicking on the control X in the top right corner of the preview window, the form simply closes out and there is no more form to be seen, just a blank screen....
0
2010
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 little window on the top left hand corner of the screen. Thinking that this may have something to do with the Print Preview dialog not being able to detect from it's caller's size so that it can set its own size equal to that of the caller, I...
0
1770
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 a simple for for testing called Preview that only had a label on it and the text "This is a Test" is hardcoded. By doing this I now that it is not other code I have written that is causing this. The problems I am having are: 1) The Preview form...
3
4195
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): <html> <IMG name=myimg height="100"> <form action="uploadpic.php" method="post" ENCTYPE="multipart/form-data"> File: <input type="file" name="file" onChange="myimg.src=file.value" size="30"> <input type="submit" value="Upload!"> <input...
12
2519
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 a database which I need to examine. This user is able design/preview all reports on a certain database. When I copy the database to my machine, I am unable to design/preview reports. I am also unable to design/preview reports when I use my box...
2
9962
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 printer settings to print. I wanted the print preview to appear the same for all users (i.e. a default page size of 8.5x14 (legal) and portrait mode). Many users have different printers as their default (plotters etc..) and I found that various...
0
8262
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8701
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
8637
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
8364
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
8502
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...
0
7192
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
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...
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.