Filename from file_get_contents
Posted: Thu Jan 14, 2010 2:16 am
Hey guys,
I've got a php script using the Pear Excel Spreadsheet writer to output an excel spreadsheet (go to the page and you download an excel file) - that works just fine. I'm also running a cron job nightly, which runs a php script to do nightly mainteance and other things - one of these other things I'd like to add in is automatically emailing the excel file generated by that first script. I've got that working as well, but only by using file_get_contents as I have to read from a url, not a file on the server.
So, my question - how can I get the filename out of file_get_contents, or is that impossible? Pear is setting the spreadsheet's name (based on the information in it) and I don't have access to that anymore (have to make up another name when I'm emailing). Would it be best to have Pear save the excel spreadsheet on the server, then use fopen to grab and email that file instead?
Thanks
I've got a php script using the Pear Excel Spreadsheet writer to output an excel spreadsheet (go to the page and you download an excel file) - that works just fine. I'm also running a cron job nightly, which runs a php script to do nightly mainteance and other things - one of these other things I'd like to add in is automatically emailing the excel file generated by that first script. I've got that working as well, but only by using file_get_contents as I have to read from a url, not a file on the server.
So, my question - how can I get the filename out of file_get_contents, or is that impossible? Pear is setting the spreadsheet's name (based on the information in it) and I don't have access to that anymore (have to make up another name when I'm emailing). Would it be best to have Pear save the excel spreadsheet on the server, then use fopen to grab and email that file instead?
Thanks