11
tzvook
Re: Attach file in news modules over 2.0.9.2
  • 2005/3/10 15:32

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Since nobody noticed Hervert question (which is the answere too ) I'll answere:

The news uploader is using class/uploader.php so mime types for the files uploaded needs to be defined (the defaults are jpg, png, gif, pdf zir, tar jtar (open file news/submit.php and look for (round line 326)

$permittedtypes=array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png' ,'application/x-zip-compressed''application/pdf''application/x-gtar''application/x-tar');


If you want your users to be able to attach some more file types, add those as changed here (WORD and EXCELL addition):

$permittedtypes=array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png' ,'application/x-zip-compressed''application/pdf''application/x-gtar''application/msexcel''application/msword''application/x-tar');


Some popular mime types to choose from:

application/pdf => PDF Document
image/x-png => PNG Image
video/vivo => VIVO Movie
application/x-compress => Compressed Zip File
video/x-msvideo => MS Video
text/html => HTML Page
audio/x-pn-realaudio => Real Audio File
image/gif => GIF Image
video/mpeg => MPEG Video'
image/ico => Icon Files
application/x-tar => TAR Ball
image/x-MS-bmp => BMP Image
image/tiff => TIFF Image
text/richtext => Rich Text
audio/x-realaudio => Real Audio
application/mac-binhex40 => Mac Binary
audio/x-aiff => AIFF File
application/x-gzip => GZIP File
application/zip => ZIP File
application/postscript => Postscript
application/msword => MS Word doc
application/msexcel => Excel File
application/vnd.msexcel => Excel File
video/quicktime => QuickTime Movie
application/powerpoint => PowerPoint Doc
audio/x-wav => WAV File
audio/x-mpeg => MPEG Audio
image/jpeg => JPEG Image
application/x-zip-compressed => ZIP File
application/octet-stream => OCTET Stream
text/plain => Text File
image/pjpeg => JPEG Image

Was tested under both winXp Linux and FreeBSD, XOOPS 2.092 with uploader.php 1.6

Hope this will answere your question
Just be awareof the risk in letting your users upload a "Virus anabled kinda files

12
hervet
Re: Attach file in news modules over 2.0.9.2
  • 2005/3/20 19:22

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


In fact I have mixed gzip files and zip files.

13
krystinevo
Re: Attach file in news modules over 2.0.9.2

Hi everyone,

I'm running News 1.31 and I replaced the code tzvook suggested in line 442 of the submit.php file, but I was getting an error when attempting to upload Excel files: Mimetype not allowed - applications vnd.ms-excel. After taking a closer look at the code, I realized it was missing a hyphen.

Here's the code I now have in my submit.php file on line 442 which allows me to upload Excel files:

$permittedtypes=array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png' ,'application/x-zip-compressed''application/pdf''application/x-gtar''application/msexcel''application/vnd.ms-excel','application/msword''application/x-tar');


Thanks tzvook -- I wouldn't have known where to even look to make the change.

Kristine

14
tzvook
Re: Attach file in news modules over 2.0.9.2
  • 2005/6/3 23:44

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


oops, missed that

15
ebridge2001
Re: Attach file in news modules over 2.0.9.2

I had change the submit.php file. but I cannot submit zip or rar files.

why?

who can help me?


Thanks.

16
tzvook
Re: Attach file in news modules over 2.0.9.2
  • 2005/6/20 19:26

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Do you have any mistake massage?
is the /uploads/ dir chmoded 777 ???

17
ebridge2001
Re: Attach file in news modules over 2.0.9.2

Quote:

tzvook wrote:
Do you have any mistake massage?
is the /uploads/ dir chmoded 777 ???


uploads had 777


The error Message is follow:



Error while uploading the file
Errors Returned While Uploading
Unknown filetype rejected
MIME type not allowed: application/octet-stream



I upload a rar file.

18
tzvook
Re: Attach file in news modules over 2.0.9.2
  • 2005/6/22 19:40

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Try application/x-rar-compressed or application/octet-stream for the MIME type

19
ebridge2001
Re: Attach file in news modules over 2.0.9.2

Ok,Thanks.


Quote:

tzvook wrote:
Try application/x-rar-compressed or application/octet-stream for the MIME type

Login

Who's Online

357 user(s) are online (232 user(s) are browsing Support Forums)


Members: 0


Guests: 357


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits