# photoshop unexpected end of file error



## andythepandy (Jul 2, 2006)

hi,

i have had the problem where for some reason photoshop had a problem saving a file and now when i come to open it, it comes up with the error message "Unexpected end-of-file".

Please i need help, spent hours drawing it and now its gone!:-(

Thanks in advance

Andy


----------



## Elijah. (Sep 18, 2007)

Sorry bud, the file is unrecoverable. When you get this error it means Photoshop didn't save the headers and/or footers of the file correctly, rendering it useless. I think this really says it best:



> We get at least one "End of File" error patients a week. Folks, when you get this error, the file is usually helpless and lost. It doesn't matter what you did to make this happen, it happened -- get over it.
> 
> The computer did NOT finish saving the file and did NOT write the all-important headers and footers code to the file. Any file interrupted during a SAVE will most likely become corrupted and will become unrecoverable.


----------



## andythepandy (Jul 2, 2006)

thanks for the reply,

to anyone who knows the code editor BBEdit or jedit, i have heard it possible to copy the headers and or footers from a good photoshop file. could someone if this is possible show me how to do it.

Thanks


----------



## smbd (May 6, 2005)

from photoshop911:
HOW TO AVOID "Unexpected End of File" CONDITIONS

1) Never hit the reset button during a file save.
this includes any hard disk access at all, reading to and from the disk.

2) Never shut down during hard drive read or write

3) Save sequentials files.
... use the File > Save As... menu command and save the file with a sequential name so you'll know it was a "version" before. Too many people use the history palette and come to falsely rely on it as a means of file recovery. History states make no difference if the file becomes corrupted.

4) Keep the hard drive in clean, working condition
... defrag often. Keep the scratch disk free and clean

5) Always CHECK the hard drive on a new computer for error blocks
... check again each time you defrag

6) NEVER allow your hard drive to become more than 85% full
... on larger drives you can hedge to 90%, but you need free and clear disk blocks to save, read/write both temporary files and save new files. 

And, as a final note: if you have mistakingly pressed the "RESET" or "RESTART" button more than a few times (I know, it happens to us all) then set up a MACRO to re-purpose the RESET button -- or, put a lift-box over it. (simple cardboard "box" that has to first be lifted before resetting.)


----------

