Images, icons & files

How to edit uploaded text files

How to edit uploaded text files

To edit a text file you uploaded to TeleportHQ, open the Assets Manager's Uploads tab, right-click the file and choose Edit. Change the text in the code editor that opens, then click Save. TeleportHQ updates the same file, so any links to it keep working.

Before you start

  • You can edit these file types: txt, xml, json, js, css, env, yml and yaml.
  • Other files, such as images or PDFs, can't be edited in TeleportHQ. Upload a new version instead.

Steps

  1. In the left sidebar, click Assets Manager.
  2. At the top of the panel, click the Uploads tab.
  3. Find the file in the Public, Private or Functions folder. For example, opening-hours.json. You can type its name in the Search box.
  4. Right-click the file. (Or point at it and click ⋯.)
  5. Choose Edit.

    The right-click menu of a text file in the TeleportHQ Uploads tab, with Edit highlighted
  6. A window titled Editing: opening-hours.json opens, with the file in a code editor. Make your changes.
  7. Optional: click { } (tooltip Prettify code) at the bottom left to tidy the formatting.
  8. Click Save, or press Ctrl+S (Cmd+S on Mac). The window closes and the file is updated.
The TeleportHQ Editing: opening-hours.json window, with the Prettify code button and the Save button highlighted

To close the window without saving, click the x at its top right.

Check that it worked

Open the file with Edit again. Your changes are there.

  • Links to the file, such as one made with Copy Asset Link to Clipboard, show the new version without publishing. A browser that opened the file before your edit may show the old version for up to two days.
  • Files built into your site, such as files in the Private and Functions folders, change on your live site the next time you publish.

Troubleshooting

"Upload failed. The extension of your file does not match its content. Please check your file." TeleportHQ checks that json, yaml and css files are valid when you save. The window has already closed, and your changes weren't saved. Open the file with Edit again, make the change again, and look for a missing comma, quote or bracket before you click Save. For long edits, copy your text (Ctrl+A, then Ctrl+C) before you save, so you can paste it back.

"Failed to run prettier, please check the syntax." Prettify code couldn't read the file because of an error in it. Fix the error, then try again. This is also a quick way to check a json file before you save it.

"Failed to run fixer, please check the syntax." Sanitize HTML (the button next to { }) couldn't process the file because of an error in it. Fix the error, then try again.

I don't see Edit in the menu The file type can't be edited. Only txt, xml, json, js, css, env, yml and yaml files can.

Good to know

Share

Related Articles

How to upload images, videos and files

To upload files in TeleportHQ, open the Assets Manager's Uploads tab and click + → Upload Assets on the Public folder, or drag files from your computer onto the editor; they appear in the folder, ready to add to your pages, and TeleportHQ warns you when a file is heavy for a web page.

What are the Private and Functions folders?

In the TeleportHQ Assets Manager, the Private folder holds developer text files such as next.config.js that are added to the top folder of your generated project, and you show it with the Private Folder switch in Project settings → Editor → Preferences → Advanced features; the Functions folder holds .js files that become server functions at /api/<name> when you publish.

How to link to a file so visitors can download it

To let visitors open or download a file such as a PDF menu from your TeleportHQ site, upload it in the Assets Manager, right-click it and choose Copy Asset Link to Clipboard, then select a button, add a link and paste the address in the URL tab.

How to set up your sitemap, robots.txt and llms.txt

TeleportHQ writes sitemap.xml, robots.txt and llms.txt for your site every time you publish; to see or change them, click the Project settings cog, then SEO & social → Search engines, where the settings show the files your next publish writes, save on their own, and link to the files on your live site.

Which files can I upload, and how big can they be?

TeleportHQ accepts images (jpg, png, gif, svg, webp, ico), videos (mp4, m4v, mov), documents (pdf, Word, Excel, PowerPoint, zip), audio, .glb 3D models, fonts and text files; trial and Pro plans allow 10 MB per file and 1 GB per project, Premium allows 30 MB per file and 3 GB per project, and smaller files are flagged as heavy when they would slow a page down.