Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Error: "The document could not be autosaved. The file name is invalid."

While adding to an exsiting document in TextEdit, I received the error message:


"The document could not be autosaved. The file name is invalid."


I've used this same file name on this same file for the past few weeks without any issues. Even when attempting to manually save or duplicate the document, I'd receive similar error messages:


"The document "Serial Numbers" could not be saved as "Serial Numbers". The file name is invalid."


I did finally figure this one out (or just got lucky), and I'm posting it here in case someone else has this same problem. I was using command-shft-control-4 to copy some images to paste into the file and it looks like one of the last two images I pasted into my document somehow triggered these error messages. Once those last two images were deleted, my file saved correctly and with the same file name. I have no idea why a possibly corrupted image would trigger an invalid file name error, but everything's working fine now.


Hopefully this helps someone else.

iMac, OS X Mountain Lion (10.8.5)

Posted on Mar 19, 2014 8:39 AM

Reply
3 replies

Apr 17, 2014 5:47 PM in response to Dork Chocolate

When you copy images from a web page it apparently can sometimes give it wonky files names.


If you R-click on a .RTFD type file and Show Package Contents, you see all sorts of weird filenames for the images you obviously did not assign. eg, 2__#$!@%!#__Pasted Graphic 5.tiff


My only guess is that, on certain websites, either the website or the mechanism of filename assignment creates a filename with a restricted character that it CANNOT save to the .RTFD's package contents subdirectory. And, frustratingly, there's no Cmd-I (Show Info) to see what the internal filename of any particular image is in a .RTFD (at least before it's saved, that is); after it's saved, obviously, you can root around in the package contents.


What I also think is weird is that i can Cmd-C and then Cmd-V these images [in TextEdit], but they are _not_ in my Clipboard. (I thought that was the definition of what the Clipboard was: Cmd-C copies to it; Cmd-V pastes. But, No.) I can Cmd-C in TextEdit, but then, if I try to use Preview or Photoshop and create a new image from Clipboard, it's empty. WITHIN TextEdit however, Cmd-C/Cmd-V works fine with these wonky images.


Of course, as has been discussed, the only way to save the file [without getting the "File name is invalid" error] is to get rid of the wonky images, with their apparently offending filenames.


-----

FWIW, I'm on a rather older version of TextEdit: Version 1.6 (264) running on OS 10.6.8.

Apr 17, 2014 6:19 PM in response to Petzl20

OK, I found out what the exact problem and the workaround is. I looked at what the filename of the image I was copying from the website. It was monstrously large (429 characters). To wit:

eyJhIjogIjcwMCIsICJjIjogImtlZXBjYWxtIiwgImIiOiAiNjAwIiwgImUiOiAiNDAiLCAiZ

CI6ICI1NSIsICJnIjogIiM3ODc4NzgiLCAiZiI6ICIjYzFiZWEyIiwgImkiOiAiYW5kIGR

vZXMgZWF0IG9hdHMiLCAiaCI6ICJMYW1icyBlYXQgb2F0cyIsICJrIjogIkEga2lkJ

2xsIEUgZGl2ZXkgdG9vIiwgImoiOiAiYW5kIGxpdHRsZSBsYW1ic3kgZGl2ZXkiLC

AibCI6ICJXb3VsZG50IHlvdSIsICJvIjogIi9yZXMvaS9lbWJsZW1zL2Nyb3duLnBu

ZyIsICJwIjogIi9yZXMvaS9iZy9ub25lLnBuZyIsICJzIjogIkZhbHNlIiwgInIiOiAia2Vlc

GNhbG0ifQ==.png


Instead of copy/pasting the image directly from the website, I saved the image to file (R-Click, Save Image As) with a short filename, then copy/pasted that into the TextEdit document. It now allows me to save the TextEdit document without getting the "invalid file name" error.

Error: "The document could not be autosaved. The file name is invalid."

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.