Solved

Reading Files by client from Web Server via http

Posted on 2000-03-27
6
170 Views
Last Modified: 2013-11-13
I need to create a code on the client side [client-server app on the web] to read a file (.pdf) from the web server directory (the path is given). How can I use "get file" sintax to do so (if it is possible)? I vaguely remember the way it goes, like fso.get file[url: http://....], so I can download file info and, subsequently the whole file into client's local directory for further manipulations...Please, help!

Thank you for your time and effort
0
Comment
Question by:alexfrumkin
6 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2661790
www.vbip.com is a great site for internet coding. Download examples there to get all you need to know about loading files off the web
0
 
LVL 9

Expert Comment

by:samopal
ID: 2661856
To download file from the web just put on your form Internet Transfer Control and add line in code

sFile$=Inet1.OpenURL("www....")

HTH
0
 

Author Comment

by:alexfrumkin
ID: 2661893
What is Internet Transfer Control?
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 3

Accepted Solution

by:
wpsjr1 earned 75 total points
ID: 2662032
A GET request can be sent by the Winsock Control (the inet control is SO buggy) or Winsock API.

First open your file for Binary.

In your Winsock1_Connect event put:

Winsock1.SendData "GET /directory/filename.ext HTTP/1.0 & vbCrLF & vbCrLf

Then in the DataArrival event you PUT from the buffer to the file.

When the Winsock1_Close event fires you can Close the filenumber.

Enjoy!  :)

Paul
0
 

Author Comment

by:alexfrumkin
ID: 2664373
Thank you. Could you be just a little more specific? I have the file at the server at (for ex.) url=http://12.24.35.test/file.pdf (this is just fictional directory for sample).
I need to have a code at the client to get this file. Could you put a few line of coding to illustrate your suggested solution, please?

Thank you very much

Alex
0
 
LVL 9

Expert Comment

by:samopal
ID: 2664379
Internet Transfer Control is one of the VB components (WinSock control too). Go to Menu -> Project -> Components (or press Ctrl+T) and select component you need.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
to transfer string from C lanaguage to VBA 4 64
VBA/SQL - Connect to SQL server and pull data 4 108
fso.FolderExists("\\server\HiddenFolder$") 4 65
Problem to App 4 81
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

770 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