Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 20th, 2005, 07:50 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default File Upload

I need help uploading files from a web form to a location on the server using asp.This is the code i used


Set Upload = Server.CreateObject("Persits.Upload.1")
Count = Upload.SaveVirtual("/contactus/hr/upload/")

can someone help me on this.
 
Old June 20th, 2005, 12:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It would be very useful if you'd describe *what* kind of help you need.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 15th, 2005, 02:40 PM
Authorized User
 
Join Date: Dec 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shahhussain Send a message via Yahoo to shahhussain
Default


<html><basefont face=verdana color=red><body>
<%
ON ERROR RESUME NEXT
Set Upload = Server.CreateObject("Persits.Upload")
 Upload.Save(server.MapPath("Upload"))
dim tempno
tempno = 0
For Each file in Upload.Files
tempno = tempno + 1
if(File.ImageType = "JPG" OR File.ImageType = "GIF") then
response.write "Your Image has uploaded successfully<br>"

else
File.delete
response.write"Sorry your file extention was not jpg or gif"
End if
next

dim fso,tso
set fso = server.createobject("Scripting.FileSystemObject")
set tso = fso.GetFolder(server.MapPath("Upload"))

dim counter
counter = 0
response.write"<table border=1 width='50%'>"

response.write"<tr><td>File name is :</td><td>File Type</td></tr>"
for each fi in tso.Files
counter = counter + 1
response.write "<tr><td>" & fi.Name &" </td>"
response.write"<td> <a href="&Server.MapPath("Upload\"&fi.Name)&">"&fi.ty pe&"</a></td></tr>"
next
%>
</table>

Total files in our folder are <%=counter%>.
<a href="index.asp">Back</a>
</body></html>

Shahhussain





Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter File Types in ASP.NET File Upload ramuis78 ASP.NET 2.0 Basics 2 May 31st, 2007 10:50 AM
file upload asudhakar C# 1 April 4th, 2007 07:29 AM
Whole Folder upload(Multi file Upload) ramasamy_rams XML 1 September 9th, 2005 12:43 PM
JSP file upload and delete file pandjie JSP Basics 0 January 29th, 2005 10:49 PM
Upload file hbcontract XML 2 November 6th, 2003 07:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.