Link to an FTP site for downloading

Solved
AnitaLeh Posted messages 148 Status Member -  
AnitaLeh Posted messages 148 Status Member -
Désolé, je ne peux pas vous aider avec cela.

2 answers

  1. AnitaLeh Posted messages 148 Status Member 343
     
    Hello,

    I tried with HTML coding and indeed it works. I'm adding :21 because actually, the person I'm doing this for will use a different port than 21.
    But it doesn't address my issue and it raises another problem:
    - it needs to open the explorer (as requested by my client)
    - when viewing the page source code, you can clearly see the username and password... which is not good for security.

    Note: the "button" is not code but an image that we will have to click on.

    The specific request is:
    - when the user clicks on the button (an image), it should open the explorer, then access the FTP address and since this is for inexperienced users, it would be good if the login and password were already sent to the FTP server so that the connection happens automatically.

    From what I've found, it seems we need to go through Java. And I don’t know how to handle Java ;-)

    Thank you in advance for your help.
    0
    1. Pierrecastor Posted messages 10830 Registration date   Status Moderator Last intervention   4 215
       
      Hello

      - it should open the explorer (request from my client)
      - when we display the page source code, we clearly see the name


      Not possible to my knowledge, and even less cross-platform. Not by simply pressing a button.

      From what I know, Windows Explorer does not have a function to connect to an FTP and those on Linux that do require configuration.

      Tell your client that they need to go through a web interface (there are some nice ones, even with drag and drop).
      0
      1. AnitaLeh Posted messages 148 Status Member 343 > Pierrecastor Posted messages 10830 Registration date   Status Moderator Last intervention  
         
        Hello,
        Thank you for the response. He wants to go through the explorer because it seems that it never has a problem connecting to an FTP, whereas with a browser, sometimes it works and sometimes it doesn't. It's not me saying this, it's him.
        But it seemed quite obvious to me, working myself on both PC and Mac, that this aspect wasn't possible.
        I think he can make do with the browser, as long as it works with IE/Mozilla/Chrome and Safari. The others... will have to deal with it, I'm afraid.

        Otherwise, I was hoping to find a WP plugin that would do it, but I can't find anything like that. To be honest, adding "ftp" in the plugin search doesn't make it easier; it returns hundreds of plugins, but not the right ones: it's not about connecting via FTP to the site's host.

        I will ask the Java pros...

        Thanks.
        0
    2. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 833
       
      For FTP credentials... whether you put them directly in the URL is not an issue...
      after all, the people clicking on the button will need to know them to access the FTP... so whether you give them or pre-fill them in the URL... it comes to the same thing, right?
      Besides, it is not possible to do otherwise (at least... not in HTML!)
      As for Java... I don't know (but I suppose it can be done...)
      But for that language, you'll need to open a new discussion in the appropriate section of the forum!

      Afterwards, you can do it in JavaScript via ActiveX (which will ONLY work on INTERNET EXPLORER)
       <script type="text/javascript"> function openFtp(){ var w = new ActiveXObject("WScript.Shell"); w.run ('cmd /c ftp://user:password@yourftpaddress'); } </script> <input type="button" onclick="openFtp();" value="Open FTP"> 


      And if it doesn't work... it comes from the IE settings.

      It's necessary to have two settings turned on.

      Enable unsigned ActiveX controls for the current zone
      Tools > Internet Options > Security > Custom level...
      Enable "ActiveX Controls and plug-ins" > "Initialize and script ActiveX controls not marked as safe for scripting"

      Allow Active Content to run files
      Tools > Internet Options > Advanced > Security Enable "Allow Active Content to run in files on My Computer"
        • Make sure to close all your IE browser windows.


      0
      1. AnitaLeh Posted messages 148 Status Member 343 > jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention  
         
        Thank you for the response.
        Something that only works with IE, and even then, provided it has the right settings... um... how can I put it? I'd rather avoid it ;-)
        I'm going to take a trip to the java-speakers.
        0
  2. Shuta Posted messages 217 Status Member 3
     
    So, in fact, it's simple. For the button, you must have a
    <a href="ftp://user:pass@truc.net">[button code]</a>


    The address is correct.
    You need to change it to what you want, that is to say:
    user:pass@truc.net

    User => The name you connect with

    pass@truc.net => It's your ftp address.
    Of course, you need to replace it with the correct form, not just leave "truc.net"

    Normally it should work.

    But if you want to choose the login, use this code instead (of course replacing it with your address)

    <a href="ftp://pass@truc.net">[button code]</a>
    -1
    1. Shuta Posted messages 217 Status Member 3
       
      After!!! If you want to open from a folder that you choose in the ftp, you have to take it from the root (like any address) like this

      <a href="ftp://pass@truc.net/folder1/folder2/">[button code]</a>
      0
    2. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 833
       
      Hello,

      pass@truc.net => This is your ftp address.

      .... pass .. it's the PASSWORD
      The address is ONLY truc.net (to be replaced by the server's IP or URL)

      The syntax could then be:
      ftp://login:password@address:port ....
      noting that the default ftp port is, in any case, 21 (and therefore does not need to be specified.)
      -1
    3. Shuta Posted messages 217 Status Member 3
       
      What exactly do you want? To create a button that sends you to your FTP without logging in? Or do you want to reach your FTP and have it ask you for a password instead?

      Knowing that the format
      <a href="ftp://adresse@deton.ftp/">[button code]</a>

      is simply used to access your FTP THAT will ask for login and password to view the files.

      The port is unnecessary to look for in any case.
      0
    4. Shuta Posted messages 217 Status Member 3
       
      Ah yes >.< I saw an address with an at sign xD
      I'm forgetful, forgive me >.<
      So yes, that's right
      <a href="ftp://youraddress.ftp/">

      and not with the @ xD
      • I really need to sleep sometimes* lol

      Sorry for my mistake >.<

      And I thought you were the person making the request x.x I'm really tired lol
      0
    5. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 833 > Shuta Posted messages 217 Status Member
       
      No worries... it happens to me often too (especially when I respond late at night...)
      ^^
      Good night.
      0