Solved

ASP Upload with VB dll's

Posted on 2001-08-21
4
408 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

914 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

18 Experts available now in Live!

Get 1:1 Help Now