New problem with old gradebook

New problem with old gradebook

by Marc Dastous -
Number of replies: 5

Good afternoon folks!!

From the category of "I love my host but..."

My host, Powweb, recently sent this message:

"PHP's default upload_tmp_dir was /tmp, which is no longer world writeable as this is where the worms using the phpBB exploit download their programs to spread. This was necessary to stop our servers from attacking others. Your scripts should not download files to this area anyways as it is not available on all the servers your site is hosted on. "

Not a problem, for uploads.  I changed the directory in my custom PHP.ini file to reflect my own personal directory.  However, now the Excel button in my gradebook no longer works.  Since the tmp directory has been disabled and memory cannot be used, it can't create the tmp file for Excel.

Can anyone suggest a work around for this, aside from downloading the .txt file and opening it in Excel?

Happy New Year!

Marc

In reply to Marc Dastous

Re: New problem with old gradebook

by Steve Hyndman -

Marc,

When you click on the Excel download button, do you get an option to "Save" the file? I thought if you saved the file (vs opening it) that it didn't need to use the temp directory...maybe I'm wrong on this though.

Steve

In reply to Steve Hyndman

Re: New problem with old gradebook

by Marc Dastous -

Thanks Steve,

Tried that, same result when the file is opened.

NEXT!!! wink big grin

In reply to Marc Dastous

Re: New problem with old gradebook

by Steve Hyndman -

Hummm...I'm afraid that exhausted my limited knowledge on this smile

Hopefully, someone else may have an idea.

Steve

In reply to Marc Dastous

Re: New problem with old gradebook

by Stephen Edwards -
I ran across the same problem last semester. A temporary file is always used to create the Excel output. I fixed the problem by slightly editing the lib/excel/OLEwriter.php file. The _initialize() function calls tempnam() to generate a temporary file name and explicitly specifies "/tmp" as the location for the temporary file. I just changed this string constant to a different dir. A "real" fix is probably to move this into some setting in the config file, but I was just looking for a quick workaround. Hope this helps.
In reply to Stephen Edwards

Re: New problem with old gradebook

by Marc Dastous -

That did the trick!!!!  Awesome thank you!!!

I do agree that this variable should be set in the config.php, however, that only makes sense for more flexibility.  Is this something that should be forwarded to the developer forum or to the bug report?

Marc