Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIFFS - FSBrowser #1820

Closed
q-bird opened this Issue Aug 31, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@q-bird
Copy link

q-bird commented Aug 31, 2018

Hi there,

I want to upload a webserver folder to Flash using FSBrowser.ino example, everything is working fine.
Then I want to use a non-standard font with the extension .woff2.
I copied a font file .woff2 to "data" folder and tried to upload using "ESP32 Sketch Data Upload" Tool...
But it showed an error:

/KFOkCnqEu92Fr1MmgVxEIzIFKw.woff2
SPIFFS_write error(-10010): unknown
error adding file!
SPIFFS Create Failed!

I was trying to add something in the code like:

String getContentType(String filename) {
  if (server.hasArg("download")) {
    return "application/octet-stream";
  } else if (filename.endsWith(".htm")) {
    return "text/html";
  } else if (filename.endsWith(".html")) {
    return "text/html";
  } else if (filename.endsWith(".woff2")) {
    return "font/woff2 woff2";
  } ...

I tried with return "font/woff2 woff2";, return "application/font-woff2";, return "font/x-woff2";...
But I still got the same error.

Is there any way to upload .woff2 font-file to Flash?

Thanks in advance!

@MarkyAD

This comment has been minimized.

Copy link
Contributor

MarkyAD commented Aug 31, 2018

@q-bird this area is for reporting issues with the esp32 core code. You should close your issues here so the developers dont have to weed through posts that are not core issues. Use a forum like esp32.com for "how do I..." type questions. SPIFFS filenames are limited to 31 characters. There are no paths or special characters in SPIFFS filenames, so every character counts toward that limit. Your filename as shown above is 33 characters.

@q-bird

This comment has been minimized.

Copy link
Author

q-bird commented Aug 31, 2018

@MarkyAD
Thanks for your advice :)
And I also resolved this problem by changing the file name!

@q-bird q-bird closed this Aug 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.