Solved

upload files with activex (html) object

Posted on 2004-04-07
8
175 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
[X]
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
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

737 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