Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. File Uploading Scripting

File Uploading Scripting

Scheduled Pinned Locked Moved Web Development
questiondesignsysadminhelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    A R 0
    wrote on last edited by
    #1

    Hello guys, I recently read a question in the forum regarding a server-side program to upload a file. I have a question from the Client side point of view. I'm developing an application to automate the filling of a particular form. This is a program in which there is no user interface at all (i.e. browser) but just communications (tcp/ip and http). The problem is that there is a field which is an input element of type file. As you know, the value's attribute of this element is read-only from the scripting point of view (there is no way to fill this field's value through a scripting function). My question is, does somebody knows how to tell the server application that there is a file ready in a specific location without typing in the field manually? In other words, there is a way to set the value of this element through a function?. Thanks much. A.R.

    M T 2 Replies Last reply
    0
    • A A R 0

      Hello guys, I recently read a question in the forum regarding a server-side program to upload a file. I have a question from the Client side point of view. I'm developing an application to automate the filling of a particular form. This is a program in which there is no user interface at all (i.e. browser) but just communications (tcp/ip and http). The problem is that there is a field which is an input element of type file. As you know, the value's attribute of this element is read-only from the scripting point of view (there is no way to fill this field's value through a scripting function). My question is, does somebody knows how to tell the server application that there is a file ready in a specific location without typing in the field manually? In other words, there is a way to set the value of this element through a function?. Thanks much. A.R.

      M Offline
      M Offline
      markkuk
      wrote on last edited by
      #2

      With file select controls, the client is supposed to send the contents of the file in the body of the HTTP request resulting from submitting the form, it doesn't just "tell that there is a file ready". See Form Submission section of the HTML 4.01 spec

      A 1 Reply Last reply
      0
      • A A R 0

        Hello guys, I recently read a question in the forum regarding a server-side program to upload a file. I have a question from the Client side point of view. I'm developing an application to automate the filling of a particular form. This is a program in which there is no user interface at all (i.e. browser) but just communications (tcp/ip and http). The problem is that there is a field which is an input element of type file. As you know, the value's attribute of this element is read-only from the scripting point of view (there is no way to fill this field's value through a scripting function). My question is, does somebody knows how to tell the server application that there is a file ready in a specific location without typing in the field manually? In other words, there is a way to set the value of this element through a function?. Thanks much. A.R.

        T Offline
        T Offline
        Troy Marchand
        wrote on last edited by
        #3

        What you are asking for is specifically blocked by browsers for security reasons. Otherwise it would be easy to try and get files from users machines without them knowing. (ex. c:\Winnt\...) One thing you can do is have an ActiveX control loaded into the browser. Then you can use the control programactically to send the file to the server. Such a control can be easily built using Dundas Software's TCP/IP product.

        A 1 Reply Last reply
        0
        • M markkuk

          With file select controls, the client is supposed to send the contents of the file in the body of the HTTP request resulting from submitting the form, it doesn't just "tell that there is a file ready". See Form Submission section of the HTML 4.01 spec

          A Offline
          A Offline
          A R 0
          wrote on last edited by
          #4

          Yes Mark, that is exactly what I need to do. Send the contents of the file in the HTTP address request, but in an automated way. To make myself clear, let's say that I need to send my users one page after the file has been uploaded in the server, trying to "emulate" a user's keyboard typing. I already read the Form Submission topic, and all about the element specification. Thank you.

          1 Reply Last reply
          0
          • T Troy Marchand

            What you are asking for is specifically blocked by browsers for security reasons. Otherwise it would be easy to try and get files from users machines without them knowing. (ex. c:\Winnt\...) One thing you can do is have an ActiveX control loaded into the browser. Then you can use the control programactically to send the file to the server. Such a control can be easily built using Dundas Software's TCP/IP product.

            A Offline
            A Offline
            A R 0
            wrote on last edited by
            #5

            Troy thank you for taking the time. I am working without a browser, but just at the communications level (i.e. no user interface at all). On the other hand, I'm not trying to get a file from a user's machine. This is the scenario: I'm running an e-commerce site server. In this sense, I have my own server-side processes. One of my services is a report file generator, so when one of my users have been logged and requested this report, my server-side program creates this report and presents it in a PDF format. However, there is a special client which needs that my site (back-end process) could upload this report to his server. Unfortunately, he doesn't know anything about FTP. In his site, once you have logged in, there is a form which presents this to type or through the browse button specify the file to be uploaded. Okay, with this in mind, what I want to do is just automate this process, to eleiminate the need of loggin with username/password and go step by step just to upload the file. Up to this point, my program loggs in and passes every page perfectly (again, without a browser) but in this specific page it fails. I do not know how to send the content of the file through the HTTP request. If you know some literature about multipart/form-data submissions I will appreciate teh reference. I develop all my server-side programs in C++, and just the client-side is JavaScript, DHTML & HTML. Thank you again.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups