Skip to content

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

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

Closed
PhilippRott opened this issue Feb 25, 2018 · 12 comments
Closed

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

PhilippRott opened this issue Feb 25, 2018 · 12 comments
Assignees
Milestone

Comments

@PhilippRott
Copy link

PhilippRott commented Feb 25, 2018

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!

@earlephilhower
Copy link
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. :)

@PhilippRott
Copy link
Author

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

@earlephilhower
Copy link
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")

@PhilippRott
Copy link
Author

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

@PhilippRott
Copy link
Author

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

@earlephilhower
Copy link
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.

@earlephilhower
Copy link
Collaborator

PR #4451 fixes, link

@earlephilhower earlephilhower self-assigned this Jan 23, 2019
@earlephilhower earlephilhower added this to the 2.6.0 milestone Jan 23, 2019
@earlephilhower
Copy link
Collaborator

Related to #5525

@devyte
Copy link
Collaborator

devyte commented Oct 29, 2019

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

@earlephilhower
Copy link
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.

@devyte
Copy link
Collaborator

devyte commented Nov 6, 2019

Pushing back after internal discussion

@devyte devyte modified the milestones: 2.6.0, 2.7.0 Nov 6, 2019
@earlephilhower
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants