Hirdetés
- Lassacskán fenyőfát állítanak a hardverek
- Tudjuk, de nem tesszük: a magyarok többsége nem törődik adatai védelmével
- Mesébe illő csodakábelt tervezett a GeForce-ok leégése ellen a Segotep?
- Irodát kért, de gyárat kapott Elon Musk a Samsungtól
- Nyílt forráskódú lett a legegyszerűbben használható AI tartalomgeneráló
- Mesébe illő csodakábelt tervezett a GeForce-ok leégése ellen a Segotep?
- Épített vízhűtés (nem kompakt) topic
- TCL LCD és LED TV-k
- Több száz játékban kezdi meg karrierjét az FSR Redstone
- Milyen processzort vegyek?
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- Milyen házat vegyek?
- AMD Navi Radeon™ RX 9xxx sorozat
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Tomika86
senior tag
válasz
Janos250
#17922
üzenetére
Köszönöm a választ!
És ha jól gondolom ezek is csak azért vannak, hogy az spiffs-ről beolvassa a tartalmakat.
String getContentType(String filename){
if(server.hasArg(F("download"))) return F("application/octet-stream");
else if(filename.endsWith(F(".htm"))) return F("text/html");
else if(filename.endsWith(".html")) return F("text/html");
else if(filename.endsWith(F(".css"))) return F("text/css");
else if(filename.endsWith(F(".js"))) return F("application/javascript");
else if(filename.endsWith(F(".png"))) return F("image/png");
else if(filename.endsWith(F(".gif"))) return F("image/gif");
else if(filename.endsWith(F(".jpg"))) return F("image/jpeg");
else if(filename.endsWith(F(".ico"))) return F("image/x-icon");
else if(filename.endsWith(F(".xml"))) return F("text/xml");
else if(filename.endsWith(F(".pdf"))) return F("application/x-pdf");
else if(filename.endsWith(F(".zip"))) return F("application/x-zip");
else if(filename.endsWith(F(".gz"))) return F("application/x-gzip");
return F("text/plain");
}
bool handleFileRead(String path) { // send the right file to the client (if it exists)
Serial.print("handleFileRead: " + path);
if (path.endsWith("/")) path += "index.html"; // If a folder is requested, send the index file
String contentType = getContentType(path); // Get the MIME type
String pathWithGz = path + ".gz";
if (SPIFFS.exists(pathWithGz) || SPIFFS.exists(path)) { // If the file exists, either as a compressed archive, or normal
if (SPIFFS.exists(pathWithGz)) // If there's a compressed version available
path += ".gz"; // Use the compressed verion
File file = SPIFFS.open(path, "r"); // Open the file
size_t sent = server.streamFile(file, contentType); // Send it to the client
file.close(); // Close the file again
Serial.println(String("\tSent file: ") + path);
return true;
}
Serial.println(String("\tFile Not Found: ") + path); // If the file doesn't exist, return false
return false;
}
Új hozzászólás Aktív témák
- Íme az új Android Auto!
- Otthoni hálózat és internet megosztás
- Mesébe illő csodakábelt tervezett a GeForce-ok leégése ellen a Segotep?
- Windows 11
- Motorolaj, hajtóműolaj, hűtőfolyadék, adalékok és szűrők topikja
- Mibe tegyem a megtakarításaimat?
- Drón topik
- Nyaralás topik
- Counter-Strike: Global Offensive (CS:GO) / Counter-Strike 2 (CS2)
- Épített vízhűtés (nem kompakt) topic
- További aktív témák...
- Nálam már kapható a jelenlegi leggyorsabb brutál notebook: Samsung Galaxy Book 5 Edge 5G!
- Sony WF-G700 White- INZONE Buds vezeték nélküli zajszűrős(ANC) fülhallgató - Fekete, 2 év gari
- High-End AMD Ryzen 9 9950X3D, ASRock X870E Taichi + Dell AlienWare AW2725DF + ajándékok
- 24,5"-os FullHD Dell Alienware gamer monitor újszerű állapotban AW2518HF
- GAMER LAPTOP - ASUS Rog Zephyrus M16 / Intel i7 12700 / RTX 3060 6gb / 24gb DDR5 / 2TB ssd
- Dell Latitude 3310 13,3", Gold 5405U, 8GB RAM, SSD, jó akku, számla, 6 hó gar
- Gamer PC-Számítógép! Csere-Beszámítás! I5 10500T / RTX 3050 / 32GB DDR4 / 512 SSD!
- AKCIÓ! HP EliteBook x360 830 G7 i5-10210U 16GB 512GB 1 év garancia
- ÁRGARANCIA!Épített KomPhone Ryzen 7 7800X3D 32/64GB RAM RTX 5080 16GB GAMER PC termékbeszámítással
- iKing - Xiaomi 14T Pro Titan Gray Vékony, prémium kivitel, nagy kijelző 12/512
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: ATW Internet Kft.
Város: Budapest
ekkold

