Archive for July, 2007

Excel SYLK: File format is not valid error

0Chris27th Jul 2007Microsoft, Microsoft, Office

I came across this error earlier this week so thought I'd post the solution (well a link to it) here for reference.

http://support.microsoft.com/kb/323626

In a nutshell this error is caused by opening a csv in excel that has no quotes around the field names and has the first field called ID - nice one Microsoft...





Simple Function To Force Download Of A File

0Chris21st Jul 2007PHP

The following function will allow you to run a file download through PHP, you could use this to help with tracking of downloads on a site for example. Or to force a Powerpoint file to download rather than open in the browser, no matter what the users browser settings.

Note however that if you are doing file integrity checksums (md5, sha1, etc.) against the file the file passed through in this way will not have the same checksum as the file when saved on the client machine or the file stored on the server.

  1.  
  2. //-----------------------------------------------
  3. // Function to force download of a file
  4. //-----------------------------------------------
  5. public function download($file_name, $file_path, $mime_type)
  6. {
  7.         header('Content-Description: File Transfer');
  8.         header('Content-Type: '.$mime_type);
  9.         header('Content-Disposition: attachment; filename="'.$file_name.'";');
  10.         header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  11.         header('Content-Length: ' .    filesize($file_path));
  12.         @readfile($file_path);
  13.         die();
  14. }

 





PHP IMAP Error On CentOS Linux 4.2

0Chris21st Jul 2007CentOS, Linux, PHP

If you’re compiling php 5 on CentOS Linux with the IMAP functionality enabled you may get this error when restarting Apache: 

“/usr/lib/libc-client.so.0: undefined symbol: mm_dlog”

I have no idea what causes this but you can get round it by compiling it as a shared module (http://scriptmantra.info/admin_ahead_com/cPanel_AP2_PHP5.html)

I have just compiled php 5.2.3 and the error still exists (if you look at the article, it notes it as occurring in an earlier version)

Why am I posting this when an answer already exists? To raise the likelihood of the answer being found - don’t you just hate it when you can’t find a solution right away?





Word 2007 Is Great!

0Chris21st Jul 2007Microsoft, Microsoft, Office

One of the best features of Word 2007 is that you can blog directly from it, making it even easier to upload content to the web.

In some regards it’s not as advanced as ecto (or the free w.Bloggar) for interfacing with and editing raw blog content but in others it really is.

For example I have a lot of old word based science essays that I thought I’d like to publish on my personal blog and as such these contain a large quantity of things like this:

062807 1457 thatwaseasy1 Word 2007 Is Great!

When word saves a page as html for example it can convert all these math-type/equation editor plug-in objects to images which is fine if you JUST want the page as a web page.

Invariably though, if anything is saved as a webpage from word it is bloated with excess styles (hence the need for Dreamweaver’s clean up word html command) and you’ll generally want to edit it in some way to make it look more presentable, as the presentation offered by word is usually somewhat lacking.

So when you save an essay with a lot of equation objects in it, that leads to tonnes of files which are a pain to copy back into a blog manually or edit along with the page content in Dreamweaver – literally hours can be spent reformatting the document.

Word 07’s publish to blog function though cuts out all of this rubbish and generally does an excellent job in maintaining formatting (possibly because it may be restricted to sending data for the post in some predetermined minimal format or it doesn’t have to ‘worry’ about styles or html page structure so much) and also uploading the images with the correct paths/associations – which is AMAZING!

How To Add Export To Excel To Internet Explorer

1Chris21st Jul 2007Microsoft, Microsoft, Office, Microsoft, Windows

Note:

This tutorial is only for people comfortable with modifying the registry.

I do not accept any responsibility for any damage you may do to your system by following this tutorial either correctly or incorrectly.

  1. Open the registry editor by going to run… in the start menu and typing regedit
  2. You will see a tree of keys to the left and values to the right double click  HKEY_CURRENT_USER to expand the tree
  3. Open Software, Microsoft, Internet explorer in the same way as in 2
  4. Right click the Internet explorer option in the menu on the left (that you just expanded) and choose New -> Key, for the name of the new key type MenuExt
  5. Right click the new MenuExt key and add a another new key named &Export To Excel, just as you did in step 4
  6. Left click the new &Export To Excel key to highlight it and in the right hand pane you’ll see a default value setting double click this and in the value box type: res://[your path to excel goes here] /3000  
    On my machine for example I type: res://C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE /3000
  7. Close down all internet explorer windows and close regedit when you next open internet explorer you should have the export to excel option

References:

http://www.jfitz.com/tips/search.htm
http://support.microsoft.com/kb/277621