Home AMX User Forum NetLinx Studio

Saving files in to shared folders on network

Hi All,

I am working in a project that I need save some files created into Master by netlinx code, to a shared folder in a windows desktop/server.

I saw that FILE_OPEN / FILE_WRITE works only in Nextlinx Master, local or in the network. the syntax \\host\folder\file do not works.

Some one have used any other solution to solve this problem? and could share the idea with us.

Some year ago, there was the !FtpSender application by AMX, but in this case it is not possible to me use this , the windows server run the cliennt's ERP soluction, and the TI people spoke to us, "look but do not touch in the server' something like this.

So we should save the files in the exact shared folder prepared for us. This need to be through Netbios or SMB ( 139 or 445 port )

Thanks in advanced.

Joseanio Galdino

Comments

  • viningvining Posts: 4,368
    You can't ask the IT guys to run an FTP server like FileZilla on this computer? They can put the root directory where you need it and you could then only transfer files to/from that location.
  • ericmedleyericmedley Posts: 4,177
    It almost might work better to run it the other way around. Treat the Netlinx master as the server and have the computer pull the file.
  • ericmedley wrote: »
    It almost might work better to run it the other way around. Treat the Netlinx master as the server and have the computer pull the file.


    I done this , but the IT guys do not accepted this way. thay want tha the AMX controler put the file on their folder. They do not want modify their ERP to get the files on AMX FTP folder.

    Any way , thanks by your idea.
  • vining wrote: »
    You can't ask the IT guys to run an FTP server like FileZilla on this computer? They can put the root directory where you need it and you could then only transfer files to/from that location.


    There is a FTP server running in the Windows Server, I have intent to do througth ftp. But I do not found none sample of netlinx code send file througth the FTP in the forum , do you have a sample that you could share with me ?

    Thanks in advance.

  • Thanks guys,

    I found http://www.amx.com/techsupport/techNote.asp?id=287 and I will work around it.

  • Hi guys,

    I have tested the FTPModule to transfer files from netlinx to remote FTP server, but without sucess,

    So I change to another path, I made a netlinx code to conenct the remote ftp server througth telnet client on port 21, works fine, connects and i can see the user logged in, but when the code execute the command to send the file, I receives the message below.


    BUTTON_EVENT[dvTP,999]
    {
    PUSH:
    {
    send_string dvFTPSino,"'pasv',13,10"
    wait 5
    { send_string dvFTPSino,"'stor membros.xml',13,10"
    }
    }
    }


    erro message :

    Line 223 (13:43:07):: FTPSino: 220-FileZilla Server 0.9.55 beta$0D$0A220-written by Tim Kosse (tim.kosse@filezilla-project.org)$0D$0A220 Please visit https://filezilla-project.org/$0D$0A
    Line 224 (13:43:08):: FTPSino: 331 Password required for jpg$0D$0A
    Line 225 (13:43:09):: FTPSino: 230 Logged on$0D$0A
    Line 226 (13:43:13):: FTPSino: 227 Entering Passive Mode (192,168,1,2,218,120)$0D$0A
    Line 227 (13:43:24):: FTPSino: 425 Can't open data connection for transfer of "/membros.xml"$0D$0A



    I made a research in the web about this ftp error and some articles talk about port forward in the router , but the both systems AMX controler and the FTP server are in the same physical network.

    Some one have an idea about what can I do to solve the problem

    Thanks in advance
  • joseaniojoseanio Posts: 42
    joseanio wrote: »
    Thanks guys,

    I found http://www.amx.com/techsupport/techNote.asp?id=287 and I will work around it.

    Hi all,

    Someone have used the !-FTPSender code ?? I am trying to use to transfer a file from one Netlinx master to an another Netlinx master throught FTP, but the file that is writen in the destination FTP server do not has content, the file is writen empty.

    Has someone an idea about what is haping ?

    Thanks in advence

    Joseanio Galdino
  • bobbob Posts: 296
    joseanio wrote: »
    erro message :

    Line 223 (13:43:07):: FTPSino: 220-FileZilla Server 0.9.55 beta$0D$0A220-written by Tim Kosse (tim.kosse@filezilla-project.org)$0D$0A220 Please visit https://filezilla-project.org/$0D$0A
    Line 224 (13:43:08):: FTPSino: 331 Password required for jpg$0D$0A
    Line 225 (13:43:09):: FTPSino: 230 Logged on$0D$0A
    Line 226 (13:43:13):: FTPSino: 227 Entering Passive Mode (192,168,1,2,218,120)$0D$0A
    Line 227 (13:43:24):: FTPSino: 425 Can't open data connection for transfer of "/membros.xml"$0D$0A

    I made a research in the web about this ftp error and some articles talk about port forward in the router , but the both systems AMX controler and the FTP server are in the same physical network.

    If you are on a local network there shouldn't be any need to port forward. Make sure you can manually login to the ftp server and transfer the file by hand - does this work?
  • joseaniojoseanio Posts: 42
    bob wrote: »

    If you are on a local network there shouldn't be any need to port forward. Make sure you can manually login to the ftp server and transfer the file by hand - does this work?



    Hi Bob,

    Yes the servers are in a local network and I can transfer files to ftp server using any ftp client as fileZilla client or windows ftp client on prompt command.

    Thanks for any help.
  • BertoBerto Posts: 4
    Hi Joseanio,

    I'm having the same issue, the file transferred is empty. Have you resolved this issue?

    Thanks
  • Bump...I also only receive a blank text file when using the FTP sender module. Anyone have any success using the module at all, recently? Also need to know for an upcoming project, whether or not this module will still function, even though it is now "unsupported" by technical support.
  • nickmnickm Posts: 152
    This may be a bit of a stretch, but for your application it would probably get the job done:

    Set up a Raspberry Pi or similar single-board PC as a "bridge" between the windows share and AMX processor. You can set the Pi up to mount the drive on the windows side, run rsync to keep the file(s) up to date, and then run an FTP server to serve up the file for AMX.

    Just a quick idea.
  • joseanio wrote: »
    Hi guys,

    BUTTON_EVENT[dvTP,999]
    {
    PUSH:
    {
    send_string dvFTPSino,"'pasv',13,10"
    wait 5
    { send_string dvFTPSino,"'stor membros.xml',13,10"
    }
    }
    }


    erro message :

    Line 223 (13:43:07):: FTPSino: 220-FileZilla Server 0.9.55 beta$0D$0A220-written by Tim Kosse (tim.kosse@filezilla-project.org)$0D$0A220 Please visit https://filezilla-project.org/$0D$0A
    Line 224 (13:43:08):: FTPSino: 331 Password required for jpg$0D$0A
    Line 225 (13:43:09):: FTPSino: 230 Logged on$0D$0A
    Line 226 (13:43:13):: FTPSino: 227 Entering Passive Mode (192,168,1,2,218,120)$0D$0A
    Line 227 (13:43:24):: FTPSino: 425 Can't open data connection for transfer of "/membros.xml"$0D$0A


    Not sure you still are looking into this or not, but this may help you. When you send the server the PASV command, it returns information that is important in a file transfer.

    It gives you numbers separated by commas. The first four integers are the IP address of the server and the last two represent a data port. The connection you have open

    with the FTP server over port 21 is a control port. You need to open a data port whereby data can be exchanged. In this case, the last numbers are 218 and 120. The port

    is calculated by multiplying the first of these integers by 256 (218*256 = 55808) and adding it to the second (55808 + 120 = 55928). This will need to be parsed and

    computed from the response to the PASV command each time as it is upto the server to allocate this data port, which will be dynamic. So in order to actually send a file, you

    need to open a second socket to the server IP (in this case to port 55928) to transfer the data. This is why you are receiving the 425 error on the last line. You are telling it to

    store a file, and it is letting you know that it is expecting that secondary connection to be open to send the file data through. If you had opened that second connection to the

    server, it should not give you this error. Be sure to setup for the proper transfer type (ASCII, Binary, etc.) prior to sending the STOR command. Also, while an Ftp client seamlessly

    handles all of this for you, be aware that it will be your job to open the local file (FILE_OPEN) and push it out through that data port from memory. I bet someone has a module that does this

    well already, but hopefully that helps...
  • joseaniojoseanio Posts: 42
    Sorry., I was far from the forum the last months, I fixed the attached code and it works fine.
Sign In or Register to comment.