{"action":"opened","issue":{"url":"https://api.github.com/repos/espressif/esp-idf/issues/2156","repository_url":"https://api.github.com/repos/espressif/esp-idf","labels_url":"https://api.github.com/repos/espressif/esp-idf/issues/2156/labels{/name}","comments_url":"https://api.github.com/repos/espressif/esp-idf/issues/2156/comments","events_url":"https://api.github.com/repos/espressif/esp-idf/issues/2156/events","html_url":"https://github.com/espressif/esp-idf/issues/2156","id":338933158,"node_id":"MDU6SXNzdWUzMzg5MzMxNTg=","number":2156,"title":"Issue with SD Webserver (ERROR reading file types)","user":{"login":"KrrishnaShah","id":13435158,"node_id":"MDQ6VXNlcjEzNDM1MTU4","avatar_url":"https://avatars3.githubusercontent.com/u/13435158?v=4","gravatar_id":"","url":"https://api.github.com/users/KrrishnaShah","html_url":"https://github.com/KrrishnaShah","followers_url":"https://api.github.com/users/KrrishnaShah/followers","following_url":"https://api.github.com/users/KrrishnaShah/following{/other_user}","gists_url":"https://api.github.com/users/KrrishnaShah/gists{/gist_id}","starred_url":"https://api.github.com/users/KrrishnaShah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrrishnaShah/subscriptions","organizations_url":"https://api.github.com/users/KrrishnaShah/orgs","repos_url":"https://api.github.com/users/KrrishnaShah/repos","events_url":"https://api.github.com/users/KrrishnaShah/events{/privacy}","received_events_url":"https://api.github.com/users/KrrishnaShah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-06T13:09:14Z","updated_at":"2018-07-06T13:09:14Z","closed_at":null,"author_association":"NONE","body":"My code runs ok with file name extention .txt but not with .html\r\n\tTRACE(\"f_open: %s\\n\", ff_trace((res = f_open(fil, \"public/index.html\", FA_WRITE))));\r\n\tif (res != FR_OK)\r\n\t{\r\n\t\t if (res == FR_NO_PATH)\r\n\t\t {\r\n\t\t\tTRACE(\"%s\", ff_trace(f_mkdir(\"public\")));\r\n\t\t }\r\n\t\t TRACE(\"f_open: %s\\n\", ff_trace((res = f_open(fil, \"public/index.html\", FA_CREATE_NEW))));\r\n\t}\r\n\tTRACE(\"f_write: %s\\n\", ff_trace(f_write(fil, test,  sizeof(test), &len)));\r\n\tTRACE(\"f_close: %s\\n\", ff_trace(f_close(fil)));\r\n\r\n\tchar buffer[128] = {0};\r\n\tTRACE(\"f_open: %s\\n\", ff_trace(f_open(fil, \"public/index.html\", FA_READ)));\r\n\tTRACE(\"f_read: %s\\n\", ff_trace(f_read(fil, buffer,  128, &len)));\r\n\tTRACE(\"f_close: %s\\n\", ff_trace(f_close(fil)));\r\n\tTRACE(\"\\nfoo.html: %s\\n\", buffer);\r\n------------------------------------------------------------------------------------\r\nOUTPUT:\r\n------------------------------------------------------------------------------------\r\n\tf_open: FR_INVALID_NAME\r\n\tf_open: FR_INVALID_NAME\r\n\tf_write: FR_INVALID_OBJECT\r\n\tf_close: FR_INVALID_OBJECT\r\n\tf_open: FR_INVALID_NAME\r\n\tf_read: FR_INVALID_OBJECT\r\n\tf_close: FR_INVALID_OBJECT\r\n\tfoo.html: \r\n\r\n\r\n\r\n**BUT with .txt file runs gr8:**\r\n      FIL * fil = pvPortMalloc(sizeof(FIL)); uint32_t len = 0;\r\n\r\n      FRESULT res = FR_OK;\r\n      TRACE(\"f_open: %s\\n\", ff_trace((res = f_open(fil, \"public/index.txt\", FA_WRITE))));\r\n      if (res != FR_OK)\r\n      {\r\n         if (res == FR_NO_PATH)\r\n         {\r\n            TRACE(\"%s\", ff_trace(f_mkdir(\"public\")));\r\n         }\r\n         TRACE(\"f_open: %s\\n\", ff_trace((res = f_open(fil, \"public/index.txt\", FA_CREATE_NEW))));\r\n      }\r\n      TRACE(\"f_write: %s\\n\", ff_trace(f_write(fil, test,  sizeof(test), &len)));\r\n      TRACE(\"f_close: %s\\n\", ff_trace(f_close(fil)));\r\n\r\n      char buffer[128] = {0};\r\n      TRACE(\"f_open: %s\\n\", ff_trace(f_open(fil, \"public/index.txt\", FA_READ)));\r\n      TRACE(\"f_read: %s\\n\", ff_trace(f_read(fil, buffer,  128, &len)));\r\n      TRACE(\"f_close: %s\\n\", ff_trace(f_close(fil)));\r\n      TRACE(\"\\nfoo.txt: %s\\n\", buffer);\r\n-------------------------------------------------------\r\nOUTPUT:\r\n--------------------------------------------------------\r\n\tf_open: FR_OK\r\n\tf_write: FR_OK\r\n\tf_close: FR_OK\r\n\tf_open: FR_OK\r\n\tf_read: FR_OK\r\n\tf_close: FR_OK\r\n\tfoo.txt: <html><title>TEST</title><head><body>TEST page..</body></head></html>\r\n\r\n\r\n**Someone Guide me from here:**"}}
{"actor":{"display_login":"KrrishnaShah"}}