Skip to content

SDWebServer Example - Link in /edit/index.htm not working #4437

Closed

Description

@PhilippRott

Description

If you try to edit files on the sdcard by espXX.local/edit, this will work only, if file is in root path like: "/test.txt"

If you create a folder on the sd-card "/folder1/test.txt" the link on tree-view is:
<li id="/folder1/folder1/test.txt"> ...

So, the path will be double and the link is not working - files can not be edited or displayed.

My solution to fix this problem:

edit line 378 in Arduino/libraries/ESP8266WebServer/examples/SDWebServer/SdRoot/edit/index.htm
change this:
leaf.id = (((path == "/")?"":path)+"/"+name).toLowerCase();
to following:
leaf.id = (((path == "/")?"":"")+"/"+name).toLowerCase();

Hardware

Hardware: ESP32, but expecting the same for esp8266, because its a html problem!

Activity

  1. earlephilhower commented on Feb 25, 2018

    @earlephilhower
    Collaborator

    Would you like to submit a PR for your fix? Seems like you've already got a failing and passing test case with it, and it'll get your name in the "git blame" for all time. :)

  2. PhilippRott commented on Mar 1, 2018

    @PhilippRott
    Author

    I never tried to submit a PR before, need to read how to do this in the correct way ;-)

  3. earlephilhower commented on Mar 1, 2018

    @earlephilhower
    Collaborator

    If it's a problem I can do it with your info here, but it's not too complicated...there are official readmes, but below is my general flow:

    Fork the repo from github website

    git clone https://github.com/PhilippRott/Arduino
    git checkout -b fixsdwebserver
    <do changes, test>
    git commit -a
    git push (it'll give you the proper command line to push to a branch on your repo @ github)
    

    Go back to your forked repo @ GH and there'll be a new button saying "Branch X pushed Y mins ago. Click here to cubmit a pull request")

  4. PhilippRott commented on Mar 1, 2018

    @PhilippRott
    Author

    thanks for your help, my PR is now pending...

  5. PhilippRott commented on Mar 2, 2018

    @PhilippRott
    Author

    @earlephilhower seems to finished with a PR error - any idea what's the problem?

  6. earlephilhower commented on Mar 2, 2018

    @earlephilhower
    Collaborator

    I just restarted it. There was a build timeout (you can check the details link at the bottom), sometimes happens when there's heavy load on the CI system.

  7. earlephilhower commented on Jan 22, 2019

    @earlephilhower
    Collaborator

    PR #4451 fixes, link

  8. added this to the 2.6.0 milestone on Jan 23, 2019
  9. earlephilhower commented on Jan 23, 2019

    @earlephilhower
    Collaborator

    Related to #5525

  10. devyte commented on Oct 29, 2019

    @devyte
    Collaborator

    @earlephilhower what's the status here? I see the PR is ready, I assume it just needs testing?

  11. earlephilhower commented on Oct 31, 2019

    @earlephilhower
    Collaborator

    The PR's not in an acceptable state (x += (cond)? "" : "" i.e. a no-op ternary is the solution proposed).

    I need to verify the actual error, too. I don't remember seeing it fail.

  12. devyte commented on Nov 6, 2019

    @devyte
    Collaborator

    Pushing back after internal discussion

  13. modified the milestones: 2.6.0, 2.7.0 on Nov 6, 2019
  14. earlephilhower commented on Dec 9, 2019

    @earlephilhower
    Collaborator

    I've tested the existing code and am not able to reproduce any failures. I've looked at pre-existing files in subdirs on the card, and all is well. If I make /d1/d2/hello.txt, I can open it just find in the editor while navigating down on the LHS. If I use the "mkdir" button to make a subdir and then the mkfile button is pressed, I also have no problem and the links on the LHS are all good.

    Closing as can't repro...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions