Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

ftp and httpd permission

Hi all !

I'm using Cyclone 1c12 eval, NIOS IDE 5.0, Microtronix uClinux kit 1.4.

I have an image on uClinux and want to get it back ( download ) to MS Windows. I perform it via the default web page of the board (accessing board IP on Microsoft Internet Explorer).

Solution :

I added a tag "<img>" into the source code of the default webpage ( file : "/home/httpd/index.html" ) to show the image.

...

ukit.jpg

added : ../../var/1.bmp (we expect the path is "/var/1.bmp")

...

but when I browse it , the path of the image is "http://192.168.1.3/var/1.bmp" (incorrect) !!!

where "192.168.1.3" is the IP of the board

It means that when the page is browsed , the default folder is "home" and depeding on which protocol (either ftp or http) it will "look at" the appropriate folder.

how can i get the correct path of the image (1.bmp) ?

in other words , how can i get a file in uclinux from ms windows ?

Thanks,

OneNet

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi OneNet,

    I&#39;m assuming you&#39;re using boa ... first check /etc/config/boa.conf ... the DocumentRoot

    directive specifies the root directory for your files.

    > Added : ../../var/1.bmp (we expect the path is "/var/1.bmp")

    Relative path references that begin with ".." are generally a bad idea since there are some

    parsing rules that can be confusing.

    > but when I browse it , the path of the image is "http://192.168.1.3/var/1.bmp" (incorrect) !!!

    Actually, the URL is correct ... it&#39;s just not what you expected or want. Basically, the leading "../" are

    removed (sometimes referred to as "removing dot segments").

    > It means that when the page is browsed , the default folder is "home" and depeding on

    > which protocol (either ftp or http) it will "look at" the appropriate folder.

    Yep, but you can make them the same if you want by changing DocumentRoot in the conf file.

    > How can I get the correct path of the image (1.bmp) ?

    Try using a softlink to the image file in your document root directory (I believe boa will blindly follow

    a softlink) then get rid to the blasted "../.." and just use a simple relative path to the softlink like:

    link_to_img.bmp

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you want to get the file back using FTP, connect to the server and dl it. If your client is using Passive mode, you will need to replace the "ls" that is included in the distribution with a symbolic link to the ls incuded in busybox. It works for some reason and the ls.exe does not.

    If that is what you are after, and need more info, just let me know. If what you really want to do is through the web page, then I cant help.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thank scott & randog77 very much !

    That&#39;s great , we are successful in your solutions.

    Thank you so much !

    OneNet