WorryFree Computers   »   [go: up one dir, main page]

File and restrictions for Google Drive?

Hi all:

I feel like I should be able to find this in about 10 seconds, but my search mojo is completely failing me. Can anyone point me to the reference for the characters that are/are not valid in a Google Drive filename? I'd expect that I might be able to find it on https://developers.google.com/drive/api/v3/reference/files, but no luck there. (For example, I'm wondering if there's a chance that there might be something screwy like a newline character in a Drive filename...)

Pointers most appreciated!

Thanks,

Ian

1 8 2,102
8 REPLIES 8

@icrew I was not aware there were any restrictions but there are compatibility issues with how/if it works with Drive for Desktop and what it does when it hits non syncable information. -KAM

Thanks @KAM -- I'd at least expect that there'd be some restriction on the number of characters in the filename (255 or 32767 or similar), and I'd at least hope that there'd be some restriction on the use of control characters and similar. It's surprising to me that that sort of specification isn't readily findable....

@icrew my understanding is there are no restrictions with Google in the native web interface either on length or chars in names.  Literally unlimited and use whatever as they programmed expecting this.  I've never seen anything definitive otherwise.  When you want to use tools like Backupify or Drive for Desktop, etc. you can hit issues.  I also think there is a 21 folder depth restriction too.

So I could put a 10-terabyte long string in as a filename in Drive? That seems really hard to believe! I also find it hard to believe that they're supporting filenames with things like control characters (EOF and similar, for example).

Did a bit of experimenting:

I am able to name a sheet with a 10,000-character string, but trying a 100,000-character string fails with a "The server encountered an error. Please try again later." error. So clearly there's a limit in there someplace!

People of reference an signed integer 32767 limit. I just couldn't find it
definitive source. Try 32000 in your tests and then 33,000.

The interface is built on the web so what does a web browser do when you
put that type of character in the URL? I'm assuming the URL encoding can
handle any type of weird characters.

Thanks @KAM !

I also opened a support ticket about this. They also couldn't tell me much--they tried to claim that somehow the number of characters in a filename was being kept confidential for amorphous "security reasons," which I find to be utterly nonsensical. Pretty much every single other filesystem on the planet (as in all of the various flavors of Windows, Linux, and MacOS filesystems released over the years) makes it very clear what their filename restrictions are, and no one has claimed those systems are less secure for having done that.

Gah.

But rant over, what I've just decided to do is a touch of code that says "if filename is >255 characters, truncate it to 252 characters and add '...'". Should be sufficient for the reporting purposes I'm doing.

Thanks again for your help,

Ian

Nice reverse engineering.

Top Solution Authors