WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-27-2007, 09:22 AM
kiq kiq is offline
WebProWorld New Member
 

Join Date: Mar 2006
Location: London
Posts: 15
kiq RepRank 0
Default PHP image in session

Hi, I am wondering if there is a way to do either of the following with PHP:

1. Dynamically generate an image from an uploaded one without saving the uploaded file. ie. Using $_files[file][temp_name] as the source file

or

2. Delete an image file when a session ends or store and display an image as part of a session

I've not had much luck googling this so any help greatly appreciated
Reply With Quote
  #2 (permalink)  
Old 04-30-2007, 04:36 PM
steve0 steve0 is offline
WebProWorld Pro
 

Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default

If the user is uploading an image..
use the uploaded image for the duration of the visit

.. then 'unlink' the file when it is no longer needed.
use the full path to the file
unlink("/usr/vhost/some/image/dir/filename.jpg")

Also.. be sure the directory has correct permissions.
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #3 (permalink)  
Old 04-30-2007, 05:56 PM
mikesmith76 mikesmith76 is offline
WebProWorld Pro
 

Join Date: Sep 2005
Location: Manchester, UK
Posts: 253
mikesmith76 RepRank 0
Default

Could you please expand on what you are looking to do? You can use PHP to create things like thumbnails from uploaded images, is this what you have in mind?

Just one comment though

Quote:
2. Delete an image file when a session ends
This would probably require the use of a cron job to clean up old images off the server. This is because a user could close the browser without going through your logout / exit pages.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: image, php, session



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0