rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: mis on March 31, 2020, 06:29:26 AM

Title: How I use browse command line login HFS & upload or download files?
Post by: mis on March 31, 2020, 06:29:26 AM
HI,
How I use browse command line login HFS & upload or download files?
example:
win10 + cmd windows
"c:\program files\mozilla firefox\firefox" 192.168.0.103:8011\~login

I can call login page. But I can't pass user account and password to login page.

example:
win10 + cmd windows
"c:\program files\mozilla firefox\firefox" 192.168.0.103:8011\~login@user:password

It's not work. Does hfs support such a login method?

Title: Re: How I use browse command line login HFS & upload or download files?
Post by: LeoNeeson on March 31, 2020, 09:04:56 AM
HI,
How I use browse command line login HFS & upload or download files?
example:
win10 + cmd windows
"c:\program files\mozilla firefox\firefox" 192.168.0.103:8011\~login

I can call login page. But I can't pass user account and password to login page.

example:
win10 + cmd windows
"c:\program files\mozilla firefox\firefox" 192.168.0.103:8011\~login@user:password

It's not work. Does hfs support such a login method?
Hi, welcome... :)

To make use of "HTTP Basic Auth (https://en.wikipedia.org/wiki/Basic_access_authentication)" (the authentication method that HFS uses) from command line, you could simply use (only if you need to download, but not upload files):

Code: [Select]
"C:\Program Files\Mozilla Firefox\firefox.exe" -url "http://user:pass@127.0.0.1:80/protected-folder/protected-file.jpg"
But if you need to upload a file (in a password protected folder) this is much more complex (and it will not work from command line (https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options) by simply using Firefox). In that case you would need to do the "HTTP Basic Auth" using cURL (https://www.google.com/search?q=%22cURL%22+site:rejetto.com&hl=en) or Wget (https://www.google.com/search?q=%22Wget%22+site:rejetto.com&hl=en). Search the forum and you will find working examples. ;)

Cheers,
Leo.-

PS: Mmmm, a lot of new users asking questions lately, good... ??? ;D
Title: Re: How I use browse command line login HFS & upload or download files?
Post by: mis on April 01, 2020, 01:52:02 AM
hi, Thank you for your guidance and information.

I have successfully completed.
Yes, next I need to study how to upload using curl.
Thank you very much for your teaching.

Thanks again for your assistance.