Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 30th, 2007, 11:53 PM
sabu28 sabu28 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 7 sabu28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 57 m 34 sec
Reputation Power: 0
Upgrade FreeASPUpload.asp !!

Hello friends,

Those of you who are using freeaspupload.asp for uploading files to the web server, here's a valuable upgrade code snippet to be included in the original source code. The original source code allows access to the form fields only after executing the FreeASPUpload.Save("DestDir") method, ie. after uploading the file(s). So, any validation could only be done after uploading the file(s). This has now been solved by me by adding a very small method in the include file freeaspupload.asp.

Here's the code :

----------------------------------
Class FreeASPUpload

.........
.........
.........

Public Sub ReadForm()
if not uploadedYet then Upload
End Sub

.........
.........
.........

End Class
----------------------------------

Before executing the FreeASPUpload.Save("DestDir") method, call FreeASPUpload.ReadForm and then access the form fields using the FreeASPUpload.Form("...") method as required. All this can be done before uploading the file(s) with the FreeASPUpload.Save("DestDir") method.

Regards

Sabu

Reply With Quote
  #2  
Old May 15th, 2008, 11:27 AM
webit webit is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 122 webit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 8 h 19 m 8 sec
Reputation Power: 5
Hi sabu28,

Glad you've been able to come up with that code snippet. I have been triying to add a code that will limit the size of the files to be uploaded to a certain value and also check that the file to be uploaded exits in the system before saving the files to the server and if it does not exists return the users to the form.

I tried using Client side script validation using
Code:
new ActiveXObject("Scripting.FileSystemObject")
and it worked. But the only draw back is that for it to work properly the user must have to enable unsafe activexobjects. Not too many people have that enabled.

Is there anyway you can assist help with a code that will check for filesize and fileexists before saving to disks. I have put this up before in another tread in this forum.

Reply With Quote
  #3  
Old May 19th, 2008, 03:58 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,737 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 41 m 46 sec
Reputation Power: 1914
hi webit, for what you need you better contact Hacker or Cracker.
they're the only one who will tell you how they write Virus that
can manage user's computer from within website.

I hope you're not going to do that, and that you'll understand
that what you ask is not possible.

if website want full access and full control over the visitor
computer (and that's exactly what allowing unsafe ActiveX
controls is doing) then the user must first do some action and
agree to the huge risk he/she are facing.

Reply With Quote
  #4  
Old May 23rd, 2008, 05:57 AM
webit webit is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 122 webit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 8 h 19 m 8 sec
Reputation Power: 5
Quote:
Originally Posted by Shadow Wizard
hi webit, for what you need you better contact Hacker or Cracker.
they're the only one who will tell you how they write Virus that
can manage user's computer from within website.

I hope you're not going to do that, and that you'll understand
that what you ask is not possible.

if website want full access and full control over the visitor
computer (and that's exactly what allowing unsafe ActiveX
controls is doing) then the user must first do some action and
agree to the huge risk he/she are facing.



Hi,

Thats not really what am asking for, to hack into someone pc.

I want to implement a server side code leveraging on the Freeaspupload.asp include file definitions to be able to test if a file exists and the size of a file attachment before calling the method class FreeASPUpload.Save("DestDir"). I don't want users to upload a file thats more than 2mb.

I hope this is a better explanation

Reply With Quote
  #5  
Old May 23rd, 2008, 06:38 AM
richyrich's Avatar
richyrich richyrich is offline
Contributing User
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Somewhere only we know...
Posts: 4,192 richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 127528 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127528 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127528 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127528 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127528 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127528 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 1 Week 1 Day 20 h 25 m 22 sec
Reputation Power: 1209
What Shadow Wizard is saying is there's no way to check the details of a file before it's uploaded unless you get the user to install some form of control on their computer.

The details of the file will only be exposed to an Upload component/code once the file has been uploaded.

It's like me asking you to tell me what make and model of computer I'm using to type this post.

It's just not physically possible without you having some form of control of my machine.
__________________
Policy Check

I'd rather have a full bottle in front of me, than a full frontal lobotomy...

Reply With Quote
  #6  
Old May 23rd, 2008, 07:35 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,737 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 41 m 46 sec
Reputation Power: 1914
Quote:
Originally Posted by richyrich
What Shadow Wizard is saying is there's no way to check the details of a file before it's uploaded unless you get the user to install some form of control on their computer.

The details of the file will only be exposed to an Upload component/code once the file has been uploaded.

It's like me asking you to tell me what make and model of computer I'm using to type this post.

It's just not physically possible without you having some form of control of my machine.
very true, and very few people will trust you enough to have
their computer at your full control. I for one will never allow
any website to have control over my computer.
if it's required for file upload, I'll simply never upload any file.

Reply With Quote
  #7  
Old June 9th, 2008, 01:04 AM
baseballdude_'s Avatar
baseballdude_ baseballdude_ is offline
Expert Learner
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2005
Location: Wisconsin
Posts: 1,891 baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 22104 Folding Title: Starter FolderFolding Points: 22104 Folding Title: Starter Folder
Time spent in forums: 1 Week 5 Days 13 h 45 m 4 sec
Reputation Power: 70
Send a message via AIM to baseballdude_ Send a message via MSN to baseballdude_ Send a message via Yahoo to baseballdude_ Send a message via Google Talk to baseballdude_
Quote:
Originally Posted by webit
Hi sabu28,

Glad you've been able to come up with that code snippet. I have been triying to add a code that will limit the size of the files to be uploaded to a certain value and also check that the file to be uploaded exits in the system before saving the files to the server and if it does not exists return the users to the form.

I tried using Client side script validation using
Code:
new ActiveXObject("Scripting.FileSystemObject")
and it worked. But the only draw back is that for it to work properly the user must have to enable unsafe activexobjects. Not too many people have that enabled.

Is there anyway you can assist help with a code that will check for filesize and fileexists before saving to disks. I have put this up before in another tread in this forum.
Why can't you validate this on the server side?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Upgrade FreeASPUpload.asp !!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT