Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to upload files in webserver through visual foxpro c
Message
From
08/10/2011 02:41:11
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01525844
Message ID:
01525888
Views:
76
>There are a number of ways to upload files to a server. Typically you upload files via FTP if you're doing a generic file upload and when an FTP server is available to do so. If you're sending up only files without related information this is the easiest way to get data to the server. FTP is just a file transfer format - there's no logic there just a transfer. There are many libraries out there to do this including our West Wind Client Tools. Here's an example with the latter:
>
>
>o=create("wwFTP")
>
>o.FTPConnect("ftp.west-wind.com")
>o.FTPSendFileEx("/downloads/pkzip.exe","c:\temp\pkzip.exe")
>o.FTPSendFileEx("/downloads/pkunzip.exe","c:\temp\pkunzip.exe")
>o.FTPClose()
>
>
>If you need more control over the upload and you need to send additional information along with the upload and need immediate confirmation then typically you can use Web based HTTP uploads. This is the type of thing that Facebook or YouTube or any content provider uses to get data to the server. This requires that the Web Server has some endpoint Url that can accept your files. IOW, something on the server runs some code to accept your files at a URL. The upside to HTTP uploads is that the server has more control over when files are uploaded and you can capture additional information about the upload at the same time of the upload. The server can also provide more information and post processing of the uploaded data.
>Http Uploads are common with various services, but as I mentioned if the server doesn't have an HTTP endpoint to receive the files then this is not an option.
>
>To do this with wwHttp (from the Client Tools) it looks like this:
>
>oHTTP = CREATEOBJECT("wwHTTP")
>
>*** Set mode to multi-part form
>oHTTP.nHttpPostMode = 2
>
>*** Post a file and a regular form variable
>oHttp.AddPostKey("File","d:\temp\wws_invoice.pdf",.T.)
>oHttp.AddPostKey("txtFileNotes","test note")
>
>lcHTML = oHTTP.HTTPGet("http://localhost/wconnect/FileUpload.wwd")
>
>*** Display result from server
>ShowHTML(lcHTML)
>
>
>Hope this helps,
>
>+++ Rick ---
>
>
>>Hi,
>>Experts, could any one help me that how to upload some files in web server using visual foxpro commands ?
>>i.e. - I want to place some html files in my web space (which I have already booked) using visual foxpro commands or through some visual foxpro application, is it possible ? please give me some suggessions !
>>
>>Umasankar Panda

Thanks Rick,
I will try according to your suggestions, I might need some further help from you.

Have a good day !

Regards,

Umasankar
Previous
Reply
Map
View

Click here to load this message in the networking platform