?
Solved

upload files with activex (html) object

Posted on 2004-04-07
8
Medium Priority
?
180 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
7 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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 the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

750 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