-
Notifications
You must be signed in to change notification settings - Fork 26
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
luci2-io-helper: use for config download #5
Comments
First make sure there is an access scope defined for the rpcd session (http://git.openwrt.org/?p=project/luci2/ui.git;a=blob;f=luci2/share/acl.d/luci2.json#l168) File UploadBest take a look at the old prototype code here: http://git.openwrt.org/?p=project/luci2/ui.git;a=blob;f=luci2/htdocs/luci2/view/system.upgrade.js#l128 and here: http://git.openwrt.org/?p=project/luci2/ui.git;a=blob;f=luci2/htdocs/luci2/ui.js#l123 In order to upload an arbitrary file you need to issue a POST request to
Fields 1-3 must precede field 4 for the upload request to get accepted and the encoding must be Backup DownloadA backup download is easy to trigger by simply issuing a POST request to |
Example for a file upload
When you then check your router via SSH:
|
Example for a backup download
|
Hello jow, Thanks for help. Best regards Flo
|
Hello Jow, i have tested the backup as you suggest. With your curl line it is not working as expected. I always get "Backup permission denied". I think the reason is that the Content-Type was set twice first to "application/x-www-form-urlencodedand" and then "multipart/form-data" ( I have added a --verbose option to command) My line is was to get the backup file as expected But something is already is strange because it takes a long time and after that i get "curl: (18) transfer closed with outstanding read data remaining". But the backup file is complete and not corrupted? I think curl does not recognize the end of the transmission. Regards Flo |
Hello Jow, I have made a backup page. To download and upload a backup. Additional it is possible to edit the file /etc/sysupgrade.conf for. I am not sure if this meets your needs. Do you want a patch or should i make a pull request? Additionally the problem with luci-backup to download the backup file is still present i am unable to solve the issue that the download take a long time. The curl request stops with a "curl: (18) transfer closed with outstanding read data remaining". But the backup.tar.gz is not corrupted :-) Regards Flo |
@feckert Ignore the error 18 for now, I believe its an issue around content-length/chunked encoding/http 1.1 Please do a PR for this feature! |
#11 got merged now. |
Hello jow,
i am working on a page to download/upload conifguration. I have now some problem to understand the luci2-io-helper to download/upload the sysupgrade.tar.gz. Can you explain what i have to do to dowload/uploade a sysupgrade.tar.gz?
Is it possible to test it with curl (using the l2-session)
Kind Regards
Flo
The text was updated successfully, but these errors were encountered: