Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 20th, 2005, 07:50 AM
Registered User
 
Join Date: Jun 2005
Location: , , .
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.
  #2 (permalink)  
Old June 20th, 2005, 12:13 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #3 (permalink)  
Old December 15th, 2005, 02:40 PM
Authorized User
 
Join Date: Dec 2005
Location: Mingora, NWFP, Pakistan.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:18 AM.


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