Monday, October 15, 2007

Filezilla Temp Files

In earlier versions of Filezilla (less than version 3) there's an option to "View/Edit" files when you right-click them.
If you ever have a power outtage, hard drive failure, or similar catastrophic event on your system in the middle of editing a file like that on a remote system it may seem like all is lost.

However all is not lost if you've been saving as you go along.

Filezilla downloads the file into your temp folder before opening it in an editing application registered for the view/edit option, it works on that file & doesn't re-upload it untill the application closes the file.
When the application closes the file, the file is checked for changes & if it's changed you are prompted to re-upload that file & the temp file is deleted.

However, if you have a catastrophic failure before the application closes, that file is never re-uploaded which kinda sucks, but the good news is it's not deleted either.

So if you have a catastrophic failure in the middle of editing a remote file opened through "view/edit" in Filezilla, take a look in your temp folder before you open Filezilla again, your file should be in there.

An example of your temp folder on WinXP or Win2K is as follows, note that you'll need to have "hidden files and folders" visible to see the folder.
C:\Documents And Settings\Your Name\Local Settings\Temp\

Sunday, October 14, 2007

phpBB3 & UTF-8 BOM/Signature

Update: (12-6-2006) Another post about UTF-8 BOM/Signature

When phpBB.com says language files need to be saved as UTF-8 with no BOM, they have a good reason. This also goes for other PHP files as well.

Apparently PHP has a bug which causes it to treat the BOM marker in a UTF-8 encoded PHP file as data which should be sent immediately, instead of throwing it away.
This prevents PHP from sending headers via the header() method, I'm guessing it can cause some havok with cookies as well.

A tell tale sign of this is PHP error messages that look similar to the following.

With phpBB3, the error message will look somthing like this
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /geoip_install.php:1)


PHP files in general will have a similar error message with slightly different wording, note the character position pointer at the end of the filename being "1".
Warning: Cannot modify header information - headers already sent by (output started at /var/www-partition/phpBB3/geoip_install.php:1) in /var/www-partition/phpBB3/includes/functions.php on line 3368


Now, in case your editor causes you to become confused because of the wording in the encoding options being somthing along the lines of Unicode BOM and UTF-8 Signature, it is UTF-8 Signature that should be considered UTF-8 BOM.
I'm not sure how many editors call it a Signature instead of a BOM, I know Notepad2 does though.