Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 30th, 2003, 05:23 PM
richard.york's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default Storing binary data in $_SESSION variables

I was curious if I would run into any problems storing binary data in session variables.

Here is the problem er rather challenge!:
I want to design a multi-part form which may include several steps before the final data is put together and stored in a database. I want the form to be able to get past some ISPs' requirement of accepting only a single upload at a time via the max simultaneous uploads directive in php.ini. Am I interpretting that correctly or can there be multiple files uploaded in a single HTTP request... is it per HTTP request or is it allowing only one file to upload at a time one after another? I've done some research on this and can't seem to even find a reference to how many uploads may occur at a time... maybe I just dreamed the whole thing up!

I was thinking if I could design a function to build hidden fields automatically between steps and store any files in $_SESSION variables then I may have this thing licked. I wanted to go with $_SESSION variables because then if a user inadvertently closes the browser or spontaneously stops in the middle of the submission process then whatever binary data would be destroyed with the other $_SESSION data no harm done, no files left to clean up off of the server. Then after a successful database insert, destroy the leftover binary data in the $_SESSION array with unset().

Just curious if I am going to run into any limitations or possible pitfalls with this solution. I'm thinking since most ISPs limit the size of uploaded files to 2MB, no file would be larger than that and in fact I would probably impose a 1MB limit.

: )

Smiling Souls

Similar Threads
Thread Thread Starter Forum Replies Last Post
storing field values to variables imaginevictor SQL Server 2000 1 July 3rd, 2007 02:17 AM
Storing data to a variable Mikect VB Databases Basics 1 April 16th, 2007 01:53 PM
Is it possible to set $_Session Variables in java rinventive Java Basics 1 February 13th, 2006 05:41 AM
storing data in hashtable msrnivas General .NET 0 July 5th, 2005 04:07 PM
Storing objects in Session variables mega ASP.NET 1.0 and 1.1 Basics 8 November 16th, 2004 02:38 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.