Save As...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DeadMeatGF
Forum Newbie
Posts: 2
Joined: Tue Mar 01, 2005 6:32 am
Location: Derby, UK

Save As...

Post by DeadMeatGF »

Sorry if this is already available, but I can't find it!

Put very simply - I need a Save As.. dialogue.
I have a php script that generates a csv file of equipment, and I want to give the user the option of saving it to their local machine. Currently it saves to a set directory, but that has a major potential flaw - what happens when the system goes live, and two people access the page within a couple of milliseconds of each other?!? I don't want a "join the queue" system, nor do I want to risk corrupted files.

I'm sure there's a quick and easy way of doing this - can anyone please point me to it?

Cheers,
DMGF
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

First post i found searching this forum - viewtopic.php?p=189000#189000
DeadMeatGF
Forum Newbie
Posts: 2
Joined: Tue Mar 01, 2005 6:32 am
Location: Derby, UK

Post by DeadMeatGF »

I'll have a play with that one, but if I'm not mistaken (by looking at the code) it simply defines the page as a csv rather than an html page.
On the up side, that should invoke the "open or save" dialogue - on the down side I currently generate a table on-screen displaying what is in the csv, with a link to the csv file stored on the server. I'd like to keep it that way, but force the user to either store the file locally or use an option not to save the data at all.
Thanks for the quick response, and feel free to point out my fooloishness if I'm wrong - as I won't have chance to test it until late this afternoon!
Post Reply