File transfer to / from my ASP.NET application

Discussion in 'Site Programming, Development and Design' started by MikeDelp, Sep 17, 2013.

  1. Hello,

    I already have a Web application on Winhost, now I'm designing a new one for another customer.
    In this ASP.NET application I will have to manage daily file exchange with an ERP Web application.
    The file exchange will be kind of:
    - orders from my ASP.NET app to ERP
    - customers data refresh from ERP to my ASP.NET app.

    My questions are the following:
    - can I programmatically send files from my code-behind using outbound FTP?
    - can I receive files from an external system via inbound FTP, and then process them in my code-behind?

    If what I asked for is not possible, which way would you suggest me in order to exchange files with an external system?

    Thanks in advance
    Mike
     
    Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    Hi Mike,
    I don't see a problem with this as we don't block outbound connections. Make sure the server you're connecting to has opened the FTP port if they have a firewall though.

    I don't see a problem with this either except your code-behind cannot contain any code that would spawn a Windows service/processes. We don't allow background process to be run. I'm not sure what you plan to do to process the files? I haven't tried this personally, but this should work to give you an example:

    1. Write code to upload a .csv file through FTP.
    2. Write code to then read that .csv file and insert them into a database.
     
  3. Thanks Elshadriel,

    1. Write code to upload a .csv file through FTP.
    2. Write code to then read that .csv file and insert them into a database.

    This is almost exactly what I need to do for the inbound process.
    I would just like to point out that 1. will consist of an external system executing PUT to my application; is this also possible? And: what is the directory to be used for file exchange? I guess it could be /App_Data, is it?
     
  4. Elshadriel

    Elshadriel Winhost Staff

    Hi Mike,

    You may need to put in an extra step to enable the "PUT" verb. Please read this blog. As for the directory, you can use any in your web space, but I would recommend trying to put in one of these:

    /App_Code
    /App_Data
    /bin
    /_database

    They are protected by IIS. Or you can create your own directory and use Request Filtering to protect that directory.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page