Solved

upload files with activex (html) object

Posted on 2004-04-07
8
172 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

773 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