Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - File Type Error When Uploading: Status
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

File Type Error When Uploading: Status

 Post Reply Post Reply Page  12>
Author
Apps4Me View Drop Down
Newbie
Newbie


Joined: 12 December 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Apps4Me Quote  Post ReplyReply Direct Link To This Post Topic: File Type Error When Uploading: Status
    Posted: 27 January 2008 at 12:37am
Ok, I did my duty and searched as much as I can, can't seem to find a resolution to the problem I'm having.
 
.jpg and .gif files upload fine, other like .pdf and .doc generate the "The file uploaded is of the wrong type"
 
I have tried ALL of the different upload types (aspupload, dundas, etc..), no difference.
 
Multiple different files, no difference.
 
File extension list is fine, tried with and without "." in front of the extension.
 
I'm running 9.06
 
Suggestions?
 
>>>>SEE UPDATE BELOW!!!
 


Edited by Apps4Me - 27 January 2008 at 2:53am
Back to Top
Nick-V View Drop Down
Senior Member
Senior Member


Joined: 26 October 2002
Location: United Kingdom
Status: Offline
Points: 319
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick-V Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2008 at 12:50am
In the Admin area go to Upload Settings and specify the files you wish to allow.
Back to Top
Apps4Me View Drop Down
Newbie
Newbie


Joined: 12 December 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Apps4Me Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2008 at 12:55am
Originally posted by Apps4Me Apps4Me wrote:

 
File extension list is fine, tried with and without "." in front of the extension.
 
 
pdf;zip;rar;doc;txt;rtf;gif;jpg;png
Back to Top
Nick-V View Drop Down
Senior Member
Senior Member


Joined: 26 October 2002
Location: United Kingdom
Status: Offline
Points: 319
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick-V Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2008 at 12:59am

Did you see Image Types AND File Types?

Back to Top
Apps4Me View Drop Down
Newbie
Newbie


Joined: 12 December 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Apps4Me Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2008 at 2:38am

Detailed update:

Through careful stepping, I have determined that it is the following section in function_upload.asp (lines 557-568) where blnExtensionOK is getting set to false
(I changed the code to set it to TRUE if there was disallowed html and pdf and word files would upload).
 
'If the file type is an image do some futher checking
   ElseIf strExtension <> ".gif" OR strExtension <> ".jpg" OR strExtension <> ".png" OR strExtension <> ".jpeg" OR strExtension <> ".jpe" OR strExtension <> ".tiff" OR strExtension <> ".bmp" Then
    'Loop through the array of disallowed HTML tags
    For lngLoopCounter = LBound(saryUnSafeHTMLtags) To UBound(saryUnSafeHTMLtags)
      
     'If the disallowed HTML is found remove it and start over
     If Instr(1, strTempFile,  saryUnSafeHTMLtags(lngLoopCounter), 1) <> 0 Then
      blnExtensionOK = False
    
     End If
    Next
   End If

With the False above changed to True, all file extensions will upload!
 
Obviously the False is not a typo, but I think the wrong type of files are being scanned in this section.
 
QUESTION:  The comment on this section of code implies it is doing extra checking if it is an image type, but then it only looks for files WITHOUT standard image extensions.
 
Should all the "<>" be "="  ??????
 

 


Edited by Apps4Me - 27 January 2008 at 2:47am
Back to Top
Nick-V View Drop Down
Senior Member
Senior Member


Joined: 26 October 2002
Location: United Kingdom
Status: Offline
Points: 319
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick-V Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2008 at 12:36pm
When you upload a PDF or DOC are you using the File Upload button? I suspect you are trying to upload a file as an image using the Insert Image button.
Back to Top
Apps4Me View Drop Down
Newbie
Newbie


Joined: 12 December 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Apps4Me Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2008 at 2:00pm
Originally posted by Nick-V Nick-V wrote:

When you upload a PDF or DOC are you using the File Upload button? I suspect you are trying to upload a file as an image using the Insert Image button.
 
Thanks Nick, but you'd be wrong suspecting that.  Dig in the code, the parts I'm referencing are called no matter what type of upload is selected.
 
I need a Mod with experience with the code to answer this.
Back to Top
StarDust View Drop Down
Senior Member
Senior Member


Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote StarDust Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2008 at 2:05pm
Apps4Me, You should upgrade to v9.07 or v9.08 as v9.06 had some issues with uploading images edited by ADOBE.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.