ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!

Download and Activate to enter!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Download to Enter | Contest Rules

Learn More!

Tutorials | Forums

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 February 7th, 2006, 08:41 AM
grdnwesl's Avatar
grdnwesl grdnwesl is offline
Fuzzy but Ferocious User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: The Restaurant at the end of the Universe
Posts: 222 grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 18 h 55 m 22 sec
Reputation Power: 17
(regarding this thread: http://forums.aspfree.com/code-bank...ures-94647.html)

Quote:
Originally Posted by Shadow Wizard
this will not save non-image files. as for extension, I fear I didn't understand what you
mean - you try to save the file with different extension??


I disagree. I was able to upload an Excel Spreadsheet with no trouble at all.

Last edited by Shadow Wizard : June 13th, 2006 at 08:20 AM.

Reply With Quote
  #2  
Old February 7th, 2006, 08:51 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
Quote:
Originally Posted by grdnwesl
I disagree. I was able to upload an Excel Spreadsheet with no trouble at all.

you have the code from here and yet was able to upload excel file??
if so, what was the width and height it found for the file? post
your code, you probably didn't check for valid image correctly.

I have just now tried to reproduce this, and got such output:
Quote:
found 1 files...
file name: report.xls
file type: application/vnd.ms-excel
file size: 1473
invalid image!


Reply With Quote
  #3  
Old February 7th, 2006, 11:35 AM
grdnwesl's Avatar
grdnwesl grdnwesl is offline
Fuzzy but Ferocious User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: The Restaurant at the end of the Universe
Posts: 222 grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 18 h 55 m 22 sec
Reputation Power: 17
Quote:
Originally Posted by Shadow Wizard
you have the code from here and yet was able to upload excel file??
if so, what was the width and height it found for the file? post
your code, you probably didn't check for valid image correctly.

I have just now tried to reproduce this, and got such output:



OK. Here's the code copied straight from here aside from some Styling:

Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>
<!--
body {
	background-color:#FFFFFF;
}
label {
	color:#000000;
	font-family:Arial, Helvetica, sans-serif;
	font-weight:bold;
	float:left;
	width:100px;
}
button {
	margin-left:100px;
}
-->
</style>
<title>Shadow Uploader</title>
</head>

<body><!--#include file="ShadowUploader.asp" -->
<%
Dim objUpload
If Request("action")="1" Then
	Set objUpload=New ShadowUpload
	If objUpload.GetError<>"" Then
		Response.Write("sorry, could not upload: "&objUpload.GetError)
	Else  
		Response.Write("found "&objUpload.FileCount&" files...<br />")
		For x=0 To objUpload.FileCount-1
			Response.Write("file name: "&objUpload.File(x).FileName&"<br />")
			Response.Write("file type: "&objUpload.File(x).ContentType&"<br />")
			Response.Write("file size: "&objUpload.File(x).Size&"<br />")
			Response.Write("image width: "&objUpload.File(x).ImageWidth&"<br />")
			Response.Write("image height: "&objUpload.File(x).ImageHeight&"<br />")
			If (objUpload.File(x).ImageWidth>200) Or (objUpload.File(x).ImageHeight>200) Then
				Response.Write("image to big, not saving!")
			Else  
				Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
				Response.Write("file saved successfully!")
			End If
			Response.Write("<hr />")
		Next
		Response.Write("thank you, "&objUpload("name"))
	End If
End If
%>
<form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1" enctype="multipart/form-data" method="POST">
<p><label for "file1">First File: </label><input type="file" name="file1" /></p>
<p><label for "file2">Next File: </label><input type="file" name="file2" /></p>
<p><label for "file3">Last File: </label><input type="file" name="file3" /></p>
<p><label for "name">Your Name: </label><input type="text" name="name" /></p>
<button type="submit">Upload</button>
</form>


I made no modifications at all to the ShadowUploader.asp file once it was unzipped.

And here's the message that got returned when it uploaded

Quote:
found 1 files...
file name: WZ_trk_Nov2002.xls
file type: application/vnd.ms-excel
file size: 113664
image width: -1
image height: -1
file saved successfully!thank you, Weasel

Reply With Quote
  #4  
Old February 7th, 2006, 12:51 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
you didn't put correct code to check for image - the original code
posted in the first post here is for general upload and won't block
anything.

after BBD asked, I have given the required code to check for
image, and cancel the upload if it's not an image - that code can
be found in post #3 in this thread. the code you're using is taken
from the 1st post, which as I said, is for general upload and won't
block anything.

hope it's clear now, can't explain any better.

Reply With Quote
  #5  
Old February 7th, 2006, 01:01 PM
grdnwesl's Avatar
grdnwesl grdnwesl is offline
Fuzzy but Ferocious User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: The Restaurant at the end of the Universe
Posts: 222 grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level)grdnwesl User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 18 h 55 m 22 sec
Reputation Power: 17
Apparently I need to read more carefully. Slinking off to my burrow now.

Thanks Wiz
Comments on this post
Shadow Wizard agrees: lol - that gave me good laugh! cheers mate!!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Shadow Uploader - preventing user from uploading non image files


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 | 
  
 



Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap