Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


uploading a file from client to server

Posted on 1999-07-01
Medium Priority
Last Modified: 2013-12-16
I would like to know if I can upload a file from my vb application in the client to the server.IF SO, HOW?
I would be using a coldfusion application server.
Question by:harinee
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1521441
Assuming you are talking about HTTP server, use the HTTP PUT method along with the Internet Control. There is an example on how to do it in the Internet Control help

Accepted Solution

DefTones earned 400 total points
ID: 1521442
If you are using TCP/IP to upload to your server, have the server recieve data regognizably,so say if the client was sending  a file thru, you could detect it likle this
if instr(1,datacomingin,"{FILE}") then

if you know howto use tcp/ip use the mswinsock control and do this for your server
Private Sub Winsock1_DataArrival(BytesTotal as long)
dim Buffer$,pos as integer,fileisopen as boolean
winsock1.getdata Buffer$,vbstring
if instr(1,buffer$,{EOF}" then close #1                            'close file if client tells                                                                                         'us its the end of the file

if fileisopen = false then
     if instr(1,buffer$,"{FILE}" then
        buffer$ = right(buffer$,len(buffer$) - 6)                         'take {FILE} out of data'
        open "FILETOSAVEAS" for binary access write as #1
        fileisopen = true
     end if
elseif fileisopen = true then
       put #1,,buffer$
end if

==========and make the client do this==========
dim take$:take = string$(10000," ") 'make space for get procedure
winsock1.senddata "{FILE}"             'notify server a file is about to be transfered
open "FILETOSEND" for Binary access read as #1
do while not eof(1)
get #1,,take$                                  'takes 10000 bytes
winsock1.senddata take                  'puts 10000 bytes into send buffer
                                                     'you can modify size in the top 'String(10000
                                                     '," ") statement to make send buffer smaller

good luck



Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question