PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old January 10th, 2005, 01:09 PM   #1 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
[RC2] Unable to upload some SWF files

The Problem
I recently came across a problem where I was unable to upload one particular SWF file even though I've done it before with no problems and I confirmed that the SWF file type was still in my settings.

The Cause
A little research little and I found out that there are some SWF file that are really SWC files but they have an extension of SWF. They have the wrong extension so that they'll play in your browser's flash viewer as normal. Depending upon what site you go to SWC files are defined as being either component files or compressed files but, when they have an SWF extension, they behave like any other SWF file would.

Now where it get's interesting is that the Gallery is smart enough to know if somebody is trying to upload a file with the wrong extension! That's a very useful thing to have in there but when uploading these SWC files that have an SWF extension the Gallery will return an "Invalid File Type" error with no further explanation.

The Hacked Solution
Where it associated the file extension (type) to a numeric value is at the bottom of gallery_global.php but I didn't want to mess with anything there because having it know "swf" and "swc" uniquely might be useful someday in the future.

Where it checks the file's extension versus it's actual file type is in the functions_gallery_imageedit.php file (around line 405).

Look for this code:
Code:
Content visible to verified customers only.
... and replace it with this:
Code:
Content visible to verified customers only.
... and that will take care of the problem for now. What the change does is look for the numerical value assigned to the file type (in this case, "13" for SWC files) and then let's it bypass the error check if the extension is either SWC or SWF. I'm sure Brian & Zach' can offer a cleaner version to take care of it but if you need an interim solution that'll do it.


NOTE: Two things... (1) Before uploading SWF files you'll need to add an entry for SWF in your Gallery settings! (2) If you aren't working with SWF files and if you aren't experiencing any problems then this doesn't apply so there is no point in modifying your code if you don't have to.
KW802 is offline   Reply With Quote
Old January 10th, 2005, 01:27 PM   #2 (permalink)
Brian
Guest
 
Posts: n/a
Re: [RC2] Unable to upload some SWF files

Could I get you to email me the file that was causing this so I can do some tests and make sure that won't create a problem in the next version?
  Reply With Quote
Old January 10th, 2005, 01:33 PM   #3 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: [RC2] Unable to upload some SWF files

Quote:
Originally Posted by Brian
Could I get you to email me the file that was causing this so I can do some tests and make sure that won't create a problem in the next version?
No problem. Give me a few and I'll send it from my gmail account. A normal SWF file returns a filetype of 4 but this bugger was returning a 13 which led to my path of discovery this morning.

EDIT: You've got mail.
KW802 is offline   Reply With Quote
Old January 18th, 2005, 01:04 PM   #4 (permalink)
Member
 
Join Date: Aug 2004
Location: Arizona
Posts: 325
Re: [RC2] Unable to upload some SWF files

Ok so is this the same issue that I am having?? I am attempting to uload a swf file that is approx 2 megs...I have added the extension in the admincp as well as the max file size, however, when I attempted to upload it says that the file is too large and that the max dimesions at 0 x 0???

Any thoughts??
dieselpowered is offline   Reply With Quote
Old January 18th, 2005, 01:14 PM   #5 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: [RC2] Unable to upload some SWF files

Quote:
Originally Posted by xtremeoff-road
Ok so is this the same issue that I am having?? I am attempting to uload a swf file that is approx 2 megs...I have added the extension in the admincp as well as the max file size, however, when I attempted to upload it says that the file is too large and that the max dimesions at 0 x 0???

Any thoughts??
The 0x0 dimensions and the files size are two different problems.

If it's saying that it's too big then either your server doesn't support uploads bigger than X and you need then to instead upload the file via FTP or the file size for SWF in your file types table is too small.

Now if it's saying that it can't be resized and/or is showing 0x0 dimensions then try this: http://www.vbadvanced.com/forum/showthread.php?t=4112
KW802 is offline   Reply With Quote
Old January 18th, 2005, 01:25 PM   #6 (permalink)
Member
 
Join Date: Aug 2004
Location: Arizona
Posts: 325
Re: [RC2] Unable to upload some SWF files

Hi there, my server uploads are set at 40 megs...I have no problem with upload sizes as I have adjusted all the sizes in the table accordingly. Here is the error I am receiving.

"Your image is too large. The maximum dimensions for this type of image in this category are 0 x 0."

Thanks for the help!
dieselpowered is offline   Reply With Quote
Old January 18th, 2005, 01:29 PM   #7 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: [RC2] Unable to upload some SWF files

Quote:
Originally Posted by xtremeoff-road
Hi there, my server uploads are set at 40 megs...I have no problem with upload sizes as I have adjusted all the sizes in the table accordingly. Here is the error I am receiving.

"Your image is too large. The maximum dimensions for this type of image in this category are 0 x 0."

Thanks for the help!
When you added SWF to your vBa Gallery types you left the max height & width set to 0.

Your PHP configuration is able to grab the dimensions from the SWF file so it thinks it's over the max you've defined.

BTW: Since your server recognizes the dimensions, you may be interested in this hack.
KW802 is offline   Reply With Quote
Old April 8th, 2005, 10:54 AM   #8 (permalink)
Junior Member
Verified Customer
 
Join Date: Nov 2004
Posts: 26
Re: [RC2] Unable to upload some SWF files

If you add the swf AND swc extensions to the list of acceptable upload extensions, would this bypass the problem? I added swf files to the list, but I have one that gives me the invalid file type error..... probably for the reason you stated above.

Would adding both swf and swc to the ok list allow them to be uploaded? Or would the gallery have a problem with the extension not being what it thinkts it should be? Ill try it when I get a free moment tonight........
Selrahc is offline   Reply With Quote
Old April 8th, 2005, 10:58 AM   #9 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: [RC2] Unable to upload some SWF files

Quote:
Originally Posted by SelRahc
Would adding both swf and swc to the ok list allow them to be uploaded? Or would the gallery have a problem with the extension not being what it thinkts it should be? Ill try it when I get a free moment tonight........
It would still give a problem if the extension is still SWF. The problem is when an SWC file has an SWF extension but if the extensions were correct then it should upload fine. But.... by changing the extension to SWC then most other applications won't recognize it as an SWF anymore. Fun.
KW802 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload SWF files - not working AuroraMike Installs and Upgrade - vBulletin 3.0.X 1 March 12th, 2005 07:58 PM
moved to a new host, and unable to upload files. Sanjiyan Installs and Upgrade - vBulletin 3.0.X 5 January 20th, 2005 11:37 PM
how do i get .swf aka flash files to play? imported_420 How Do I? - vBulletin 3.0.X 4 January 19th, 2005 06:44 PM
[RC2] Problem? Maybe. Has anybody tried adding an "SWF" file type yet? KW802 Bugs From 1.0.0 3 December 23rd, 2004 05:36 PM


All times are GMT -5. The time now is 01:03 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0