Solved

ASP Upload with VB dll's

Posted on 2001-08-21
4
410 Views
Last Modified: 2007-11-27
I am working with a 3 tier architucture for a websupport project. I use VB dll's which are installed in webserver but the original dll residing with the application server.

Now that i have to upload files onto the webserver in the similar manner above with a VB dll and some ASP pages that will call these dll's to upload the files onto the webserver.

Can anyone provide me with the code for both the ASPupload dll written in VB code as well as the ASP pages for the same....

S.Ramanujam.
0
Comment
Question by:ramanujamsampath
  • 2
4 Comments
 
LVL 20

Expert Comment

by:Silvers5
ID: 6409672
Uploading typically requires a component, either the posting acceptor from Microsoft, ASPUpload from http://www.aspupload.com/, SAFileUp from http://www.softartisans.com, ActiveFile from http://www.infomentum.com/activefile/, or ScriptUtilities from http://www.pstruh.cz/help/ScptUtl/library.htm (which also has "PureASP" -- a way to upload without a component).
 
0
 
LVL 33

Accepted Solution

by:
hongjun earned 75 total points
ID: 6412143
VB Example
==========
Project->References and make sure "AspUpload 2.1 Type Library" is selected.
Add the below code in form code window

Private Sub Form_Load()
     Dim objUpload As ASPUPLOADLib.UploadManager

     Set objUpload = New ASPUPLOADLib.UploadManager

     objUpload.CopyFile "C:\your_file.txt", "c:\upload\your_file.txt"

     Set objUpload = Nothing
End Sub




ASP Example
===========
first_page.asp
==============
<!-- Simple Upload Form -->

<HTML>
<BODY BGCOLOR="#FFFFFF">
<h2>Sample 1: Simple Uploading</h2>

     <FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="second_page.asp">
          <INPUT TYPE=FILE SIZE=60 NAME="FILE1"><BR>
          <INPUT TYPE=FILE SIZE=60 NAME="FILE2"><BR>
          <INPUT TYPE=FILE SIZE=60 NAME="FILE3"><BR>
          <INPUT TYPE=SUBMIT VALUE="Upload!">
     </FORM>

</BODY>
</HTML>


second_page.asp
===============
<HTML>
<BODY BGCOLOR="#FFFFFF">

<%
     Set Upload = Server.CreateObject("Persits.Upload.1")
     Count = Upload.Save("c:\upload")
%>

<% = Count %> files uploaded.

<%
     If Upload.Expires <> CDate("9/9/9999") Then Response.Write "<HR>AspUpload expires on " & Upload.Expires
%>
</BODY>
</HTML>
<%
Set Upload = Nothing
%>


There's really no equivalent code between Asp and VB. For VB, you got to hardcode the file to be uploaded. But of course you can always substitute to source file and the destination using 2 textboxes for users to type. Then it becomes dynamic. You can also consider using Common Dialog box to get the source and destination file path.


hongjun
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7135198
A request has been made (http://www.experts-exchange.com/cleanup/Q_20320181.html) that this question be closed with the following resolution: points to hongjun

EXPERTS: Please leave any comment regarding this request here; I will return in seven (7) days to close the question.

Netminder
CS Moderator
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7158526
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
Age between date range query (SP) 13 69
Classic ASP application Will support SQL 2014 5 94
innerHTML 7 34
Html CheckBox obtain Its Value 5 27
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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