Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Image upload problems...
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bobmac
Starting Member

USA
14 Posts

Posted - 09 July 2013 :  23:52:42  Show Profile  Reply with Quote
Using unmodified "Mike's File Attachment," when I do a test upload, I get the following:

There is a problem with the file you are attempting to upload.


--------------------------------------------------------------------------------
Filename image0055.JPG File names must use only valid characters
Extension .jpg Certain file extensions are not accepted
Size 141.44 KB File sizes must be reasonable

--------------------------------------------------------------------------------
Please click here to close go back and try again.

All 3 parameters are within appropriate values, but I get the error. Anyone know why?

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 13 July 2013 :  02:57:42  Show Profile
In outputFile.asp about line 33, change the following from:

select case extension
	case ".jpg", ".jpeg", ".gif", ".zip", ".doc"
	allowFile=true
	case else
	allowFile=false
end select

To the following:

select case extension
	case ".jpg", ".JPG", ".jpeg", ".gif", ".zip", ".doc"
	allowFile=true
	case else
	allowFile=false
end select


You will notice the .JPG added. I trust that helps.


Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 13 July 2013 :  20:57:11  Show Profile
If it's rejecting based upon the capitalization, should really complete the job.


select case extension
	case ".jpg", ".JPG", ".jpeg", ".JPEG", ".gif", ".GIF", ".zip", ".ZIP", ".doc", ".DOC"
		allowFile=true
	case else
		allowFile=false
end select
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 15 July 2013 :  13:37:02  Show Profile  Visit AnonJr's Homepage
Semi-random thought... would it not be better to change from:

select case extension
	case ".jpg", ".jpeg", ".gif", ".zip", ".doc"
	allowFile=true
	case else
	allowFile=false
end select

To the following:

select case LCase(extension)
	case ".jpg", ".jpeg", ".gif", ".zip", ".doc"
	allowFile=true
	case else
	allowFile=false
end select


That way you don't have to add an extension twice every time you want to include a new file type, and you don't have to worry about a random cap in the middle causing problems (actually had that issue on another project...)
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 15 July 2013 :  17:36:47  Show Profile
I was just trying to point bobmac in the right direction as I did not want to write the complete code for him. I completely forgot about the LCase statement given the stuff I am going through at the moment but it is a nice easy fix. Thanks AnonJr.

Cheers,

David Greening
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 16 July 2013 :  11:07:25  Show Profile  Visit AnonJr's Homepage
Not a problem.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.91 seconds. Powered By: Snitz Forums 2000 Version 3.4.07