[PHP] Temp File missing Win2k
I am ruining PHP with IIS on Win2k. I am using a PHP app which was working fine but when the app douse a file/upload/submit in the page posted to the temporary file seems not to exist. This was working fine on my Win98 setup. Any idea what is wrong? Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] temp file part II
I have not managed to get IE to download my file on the fly as suggested. so I was wondering if there are any other suggestions on how I can create a temp file for download and after the download is complete the file is deleted. thanks randy Instead of: header("Content-disposition: filename=backup.csv"); try header('Content-Disposition: attachment; filename=backup.csv'); Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] temp file help
The following code downloads information on the fly and saves it as a file on the user's hard drive. It works great in Netscape downloads data properly but in Internet explorer it doesn't work. Here is the error I get any ideas? IE was not able to open this site the site is either unavailable or cannot be found. BUT if I right click and says "The file cannot be written to cache". I even commented out the following: header("Pragma: no-cache"); But it still did not work. Please help !!! Thanks Randy include "db.inc"; header("Content-disposition: filename=backup.csv"); header("Content-type: application/octetstream"); header("Pragma: no-cache"); header("Expires: 0"); // doing some DOS-CRLF magic... $client=getenv("HTTP_USER_AGENT"); if (ereg('[^(]*\((.*)\)[^)]*',$client,$regs)): $os = $regs[1]; // this looks better under WinX if (eregi("Win",$os)): $crlf="\r\n"; else: $crlf="\n"; endif; /* OS = WIN */ endif; /* ereg $client */ # DB STATEMENT HERE # $link_id = db_connect($default_dbname); if(!$link_id) error_message(sql_error()); $result = mysql_query($query)or print "error".mysql_error(); if(!$result) error_message(sql_error()); while($query_data = mysql_fetch_array($result)) { Variable definition/and assignment here echo "var1,var2,var3,var4,var5,var6"; echo $crlf; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] temp file help
This is a wonderful IE "feature" - it just tries to open everything regardless of the browser type. I'd be interested in any working workarounds for this. I've even sent my own type headers ... all to no avail. --Joe On Mon, Apr 16, 2001 at 03:30:30PM -0700, Randy Johnson wrote: The following code downloads information on the fly and saves it as a file on the user's hard drive. It works great in Netscape downloads data properly but in Internet explorer it doesn't work. Here is the error I get any ideas? IE was not able to open this site the site is either unavailable or cannot be found. BUT if I right click and says "The file cannot be written to cache". I even commented out the following: header("Pragma: no-cache"); But it still did not work. Please help !!! Thanks Randy include "db.inc"; header("Content-disposition: filename=backup.csv"); header("Content-type: application/octetstream"); header("Pragma: no-cache"); header("Expires: 0"); // doing some DOS-CRLF magic... $client=getenv("HTTP_USER_AGENT"); if (ereg('[^(]*\((.*)\)[^)]*',$client,$regs)): $os = $regs[1]; // this looks better under WinX if (eregi("Win",$os)): $crlf="\r\n"; else: $crlf="\n"; endif;/* OS = WIN */ endif;/* ereg $client */ # DB STATEMENT HERE # $link_id = db_connect($default_dbname); if(!$link_id) error_message(sql_error()); $result = mysql_query($query)or print "error".mysql_error(); if(!$result) error_message(sql_error()); while($query_data = mysql_fetch_array($result)) { Variable definition/and assignment here echo "var1,var2,var3,var4,var5,var6"; echo $crlf; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] /* Joe Stump * Sr. PHP Developer * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] temp file help
Instead of: header("Content-disposition: filename=backup.csv"); try header('Content-Disposition: attachment; filename=backup.csv'); Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] temp file help
Nope This doesn't work either. I am going to find header documentation and see if I can find a work around -Original Message- From: Phil Driscoll [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 17, 2001 12:48 PM To: Randy Johnson; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] temp file help Instead of: header("Content-disposition: filename=backup.csv"); try header('Content-Disposition: attachment; filename=backup.csv'); Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] TEmp File
Here is the scenario: I want to let my users download their history of transactions from a mysql database. I have that part working...they click a link a csv file is created for them to download. now here is my question. Is there a way to have the file delete after they have downloaded it? Also is there a way to have the file download as filename.csv but have the actually file that is create named a random name of numbers and letters i.e. 2s3d4f5g6h.csv My concern is to have the file be deleted after download and/or make it so no other users could guess the url and download someone else's history. Any Advice is much appreciated. thanks randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] TEmp File
On Fri, 30 Mar 2001 15:10, Randy Johnson wrote: Here is the scenario: I want to let my users download their history of transactions from a mysql database. I have that part working...they click a link a csv file is created for them to download. now here is my question. Is there a way to have the file delete after they have downloaded it? Also is there a way to have the file download as filename.csv but have the actually file that is create named a random name of numbers and letters i.e. 2s3d4f5g6h.csv My concern is to have the file be deleted after download and/or make it so no other users could guess the url and download someone else's history. Any Advice is much appreciated. thanks randy Why not create the information and download it on-the-fly? That way no files are created, no evidence left laying around, etc. I've attached (for Randy, won't get to the list) something I use to do this with output as a tab delimited file. -- David Robley| WEBMASTER Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet| http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA ?php /* This little routine will produce a tab delimited file of the contents of the expertise and people tables from the injdirect database - that's the one that runs the Directory of Injury Personnel. The tab delimited file is sent as an application/octetstream file to force saving to file, to be used for producing some kind of mailout. We can't use CSV because someone decided to put "s in the data ;-( */ header("Content-disposition: filename=maillist.dat"); header("Content-type: application/octetstream"); header("Pragma: no-cache"); header("Expires: 0"); // doing some DOS-CRLF magic... $client=getenv("HTTP_USER_AGENT"); if (ereg('[^(]*\((.*)\)[^)]*',$client,$regs)): $os = $regs[1]; // this looks better under WinX if (eregi("Win",$os)): $crlf="\r\n"; else: $crlf="\n"; endif; /* OS = WIN */ endif; /* ereg $client */ $database = "x"; //Build query here $sep="\t"; $result = mysql_db_query($database, $query); if (mysql_errno() != 0): echo "ERRNUM: ".mysql_errno()." - ".mysql_error()."\n"; endif; /* Dump a header line showing field order */ echo "title $sep surname $sep fname $sep position $sep section $sep division $sep orgname $sep mail1 $sep mail2 $sep city $sep "; echo "state $sep postcode $sep phone $sep mobile $sep fax $sep email $sep exp1 $sep exp2 $sep exp3 $sep exp4 $sep exp5 $sep description"; echo $crlf; while($row=mysql_fetch_array($result)){ extract($row); echo stripslashes($title) . $sep; echo stripslashes($surname) . $sep; echo stripslashes($fname) . $sep; echo stripslashes($position) . $sep; echo stripslashes($section) . $sep; echo stripslashes($division) . $sep; echo stripslashes($orgname) . $sep; echo stripslashes($mail1) . $sep; echo stripslashes($mail2) . $sep; echo $city . $sep; echo $state . $sep; echo $postcode . $sep; echo $phone . $sep; echo $mobile . $sep; echo $fax . $sep; echo $email . $sep; echo $expertise[intval($exp1)] . $sep; echo $expertise[intval($exp2)] . $sep; echo $expertise[intval($exp3)] . $sep; echo $expertise[intval($exp4)] . $sep; echo $expertise[intval($exp5)] . $sep; $description = stripslashes($description); echo str_replace("\n", " ",$description); echo $crlf; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]