Gmail – How to Paste a Large Amount of Text

gmail

I want to paste a rather huge amount of text into an email (approximately 100,000,000 characters). I have the text document containing said characters on hand and may copy it with ease using “select all.” However, due to the size, attempting to paste this text into the email body crashes the webpage of any browser, and caused the Mac email client to freeze when I tried that instead.

Is it possible to accomplish this goal, or is it simply beyond the scope of technology?

Just to clarify, I am aware of superior means to transport or share this text as a .zip file or using Google Drive etc., my goal is not to share this text in a tangible way, I simply want to paste it into an email.

Best Answer

The following is an untested proposed workflow to transfer the contents of a textfile to a textarea-field such as used by Gmail Compose. It may or may not work where a simple copy-paste fails. If you really want to try to enter 100MB of text into a webform, you could try it, but please consider the comments and other answers suggesting you approach the underlying problem differently.

In Firefox, use the It's All Text! addon. With this addon, you will be able to use your favourite text editor to write in any textarea field, including the one used for Gmail Compose.

Then the question changes to: how do I paste a large amount of text into [insert text editor]? The following assumes the original is in a file that is plain text.

Personally, I use vim and I do !cat /path/to/file.txt.

An approach that should work with any text editor:

  1. Note the name of the temporary file used by It's All Text!, for example, /tmp/itsalltext.txt.
  2. On the commandline, do cat /path/to/file.txt >> /tmp/itasalltext.txt.
  3. Reload the file in the text editor.
  4. Possibly edit it, if editing it, save it again and close the text editor.

Now, the contents of /path/to/file.txt will be in the textarea.

Two problems remain:

  • For sending the e-mail, you will still be limited by the maximum e-mail size mentioned elsewhere.
  • Firefox and the It's All Text! addon may not perform well when transferring dozens of megabytes into a webform. I have only used it for small amounts of text (maybe up to 10 kB).