Solved

upload files with activex (html) object

Posted on 2004-04-07
8
171 Views
Last Modified: 2013-11-13
Hello!

I had no idea how to set the exact title, but I hope it is descriptive enough. So I would like to do file upload with an VB ActiveX component inside my homepage. There is already such functionality wich can be done with html forms, but there the user has to find the file by himself. I would like to avoid this and make this activex find the file for the user.

I have done some job already: I have an activex which takes a file from a web server and saves it at a client, then it is opened by this activex so the user can read it and change it. Now, when the user is done with this file I would like to have this activex to ask the user if he wants to upload the file back to server.

I am trying to use Winsock via TCP, but it seems impossible to get connected to the server. The code is quite simple:

WS.RemoteHost = "127.0.0.1"
WS.RemotePort = 80
WS.Connect
   
If WS.State = sckConnected Then
    MsgBox "Connected"
Else
    MsgBox "Not connected"
End If

It is here winsock cannot get connected. I have tried many different addresses for remote host, but nothing works. Have anyone any clue why this is not working? Is there possibility for some proxy or other things blocking winsock? I'm sick of this behaviour, so any help is appreciated.
0
Comment
Question by:my_moon011000
8 Comments
 
LVL 1

Expert Comment

by:bfeddish
ID: 10774945

First, I'm assuming you can ping the remote hosts that you are trying to connect to.

Next, does the Connect method ever get called, i.e.

Private Sub WS_Connect()

End Sub
0
 
LVL 1

Author Comment

by:my_moon011000
ID: 10775095
I included this snippet:

Private Sub WS_Connect()
    MsgBox "Connecting"
End Sub

and this message was never shown during execution. Should it be shown or not? I have to mention that I'm executing this activex inside VB design window, I'm not deploying it directly in my homepage. Should I include it as cab package in my homepage first? Anyway, I'll try that too.  
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 10775185
Implement some type of Timer to check the state of the winsock instance after you try to connect. For example.. you can have it MsgBox if the state=9 (sckError). Usually helps to troubleshoot.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 76

Expert Comment

by:David Lee
ID: 10780055
This mayb be a foolish question but I have to ask.  Is there a web server running on your local machine?  127.0.0.1 is the localhost so if there's no web swerver running on the machine you're using for the VB work, or if the there is a web server but for some reason it's not running on port 80, then that'd explain why you're not getting a connection.
0
 
LVL 1

Author Comment

by:my_moon011000
ID: 10781576
I tried to pack ActiveX in a cab file, placed it in my serverfolder and it worked! I have connection with the server! So it was wrong to execute the project directly from VB design window.

But now I have another problem, the file is not uploaded at all. I must look more at it, for right now I cannot localize the problem. But what to do with this question now? Delete it or post this other problem too if I cannot solve it? Any suggestions?
0
 
LVL 1

Author Comment

by:my_moon011000
ID: 10867922
I think I should delete this question, but I'm not sure I know how it's done.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10907844
Closed, 500 points refunded.
modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now