Sandwich Artist
Posts: 25
186 credits Members referred : 0
« on: Feb 26, 2008, 05:04:48 PM »
Another part of the project I'm working on is taking the embedded pdf file out of an xml reply I'm receiving and give the user an option to open/save the pdf file. Well the save option works correctly, but the open option does open Adobe, but then gives the error that the file can't be found. What could be the issue...here's the code I have so far:
Sandwich Artist
Posts: 25
186 credits Members referred : 0
« Reply #2 on: Feb 26, 2008, 11:52:46 PM »
I still get the same behavior with adding the dirname(__FILE__) . to the path, the save option still works and the open option still says "file can't be found."
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8037
41179 credits Members referred : 3
« Reply #3 on: Feb 26, 2008, 11:59:30 PM »
That is not possible. Have you echoed the filename to see if it is correct?
Sandwich Artist
Posts: 25
186 credits Members referred : 0
« Reply #6 on: Feb 27, 2008, 12:37:04 AM »
yes this all resides on a w2k3 server running php 4.4.4, and yes its very strange...the really weird part is that at one point the mbstring.dll was enabled in the .ini file and while that was the case both options worked fine. but issues began to arise after the mbstring.dll was uncommented in the .ini file so we had to comment it back out, and since that change I've been unable to get the open option to work again. Makes no sense to me, but then again I've only been coding php for about 6 months.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8037
41179 credits Members referred : 3
« Reply #7 on: Feb 27, 2008, 12:41:08 AM »
I am coding php for years and I am sure this code is ok. If you haven't done anything wrong (like giving a false filename or a path that does not exist) I guess it can be some kind of issue with w2k server (I use linux and apache)
Sandwich Artist
Posts: 25
186 credits Members referred : 0
« Reply #8 on: Feb 27, 2008, 12:41:37 AM »
I just received this response to my thread on another forum.....
I had this problem with a .csv file and solved it by adding caching headers. I think IE doesn't keep it in the temporary files, since it's generated by php, so when it tries to open from there, it fails. I added:
header("Expires: ".date("D, j M Y H:i:s",time()+(300))." UTC"); header("Cache-Control: Public"); header("Pragma: Public");
Adding those headers in worked, now Open and Save options both work. Hope this helps anyone else that comes across the same issue...Thanks for everyones help trying to figure this out.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8037
41179 credits Members referred : 3
« Reply #9 on: Feb 27, 2008, 12:43:38 AM »
Headers have nothing to do with the file system though