[MOD] File Upload Module for 9.8.2 Is here for download :)

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 12-30-2007, 11:10 PM
Casual Pligger
 
Join Date: Sep 2007
Posts: 96
Ok well here it is , the 9.8.2 version of the file upload module.


Just read the readme and look at step 6 aswell it will be very important you do so

The default link_field is set to link_field3 you can easily change this in file_upload_settings.php easly

*Note* - What every # link_field you set, make sure the submit_link_field is the same number

ex Link_field1 and Submit_link_field1

Also to edit, add, or delete any mime_types please look at the file_upload_process-handlar in file_upload_main.php

other then that Enjoy

For a demo of the module please take a look at d0ink.com / Popular Articles so if you want to be sure it works before downloading. Demo will be up for a couple of days then i will take it down

Anybugs with this let me know asap!!!!!!!!!!


Future plans for module

-Add option for multiple uploads
-Verification for upload
Attached Files
File Type: rar file_upload_9.8.2_0.2.rar (21.1 KB, 131 views)

Last edited by Redux; 12-30-2007 at 11:21 PM.
Reply With Quote
  #2 (permalink)  
Old 12-31-2007, 02:14 AM
Constant Pligger/Designer
Pligg Version: 1.0
Pligg Template: silverbullet
 
Join Date: Mar 2007
Posts: 147
Send a message via MSN to skins4webs
Good stuff.
Reply With Quote
  #3 (permalink)  
Old 12-31-2007, 09:21 AM
computerbar's Avatar
Pligg Donor
Pligg Version: 9.9.5
Pligg Template: yget,lemontwi
 
Join Date: Nov 2007
Location: UK
Posts: 67
good one.
Works fine on my 9.8 site. check it out.


regards
Reply With Quote
  #4 (permalink)  
Old 01-01-2008, 03:45 PM
vib vib is offline
New Pligger
Pligg Version: 9.8.2
Pligg Template: none
 
Join Date: Dec 2007
Posts: 5
Code:
START: file_upload_process_handler.
In Get_Mime_Type function
filename = akr-odmowa.txt
sourceFile = .txt
Original filename = akr-odmowa.txt
Temp filename = /tmp/phpVXMtfP
File Mime Type = text/plain
File Combo = file_26.dat|akr-odmowa.txt|text/plain
Link ID = 26
Formatted File size = 687 b
Raw File size = 687
Max allowed file size = 100000000
Destination file = file_26.dat
Destination path = /home/estv/www/mympl/eh/downloads/
File did not pass allowed mime type check.
and red error:

1 image error(s) found.
- This file type is not allowed.

You can still submit this entry and edit it later with a smaller image or click MODIFY to try a different image.

.txt files and any files not upload (i tested more types files)
file_upload_main.php is oryginall
in settings i change only debugmode

any idea ? thnx
Reply With Quote
  #5 (permalink)  
Old 01-01-2008, 03:55 PM
Casual Pligger
 
Join Date: Sep 2007
Posts: 96
you have to go to the file_process_upload handler

But first replace the get_mime_type function with this

Code:
	function get_mime_type($filename) 
{
	// parse file to get extension
	file_upload_printdebug("In Get_Mime_Type function");
	file_upload_printdebug("filename = ".$filename);
	
	$extension = substr($filename,strrpos($filename,'.'));
	
	file_upload_printdebug("sourceFile = ".$extension);
	
	//check extension among known types
	switch($extension)
	{
	case '.xls':
	case '.xla':
	case '.xlc':
	case '.xlm':
	case '.xlt':
	case '.xlw':
		return 'application/excel';
		break;
	case '.doc':
	case '.dot':
		return 'application/msword';
		break;
	case '.pot':
	case '.pps':
	case '.ppt':
		return 'application/vnd.ms-powerpoint';
		break;
	case '.vsd':
	case '.vst':
	case '.vsw':
		return 'application/x-visio';
		break;
	case '.psd':
		return 'applicatioin/octet-stream';
		break;
	case '.pdf':
		return 'application/pdf';
		break;
	case '.eps':
		return 'application/postscript';
		break;
	case '.ra':
	case '.ram':
		return 'application/vnd.rn-realaudio';
		break;
	case '.rm':
		return 'application/vnd.rn-realmedia';
		break;
	case '.zip':
	case '.gz':
	case '.rar':
		return 'application/x-gzip';
		break;
	case '.tgz':
	case '.gtar':
	case '.tgz':
		return 'application/x-compressed';
		break;
	case '.swf':
		return 'application/x-shockwave-flash';
		break;
	case '.avi':
		return 'application/x-troff-msvideo';
		break;
	case '.mpg':
	case '.mp3':
	case '.mp4':
	case '.mp2':
	case '.mpeg':
		return 'application/mpeg';
		break;
	case '.mov':
		return 'video/quicktime';
		break;
	case '.fla':
		return 'fla';
		break;
	case '.jpg':
	case '.jpe':
	case '.jpeg':
		return 'image/jpg';
		break;
	case '.bmp':
		return 'image/bmp';
		break;
	case '.gif':
		return 'image/gif';
		break;
	case '.png':
		return 'image/png';
		break;
	case '.tiff':
		return 'image/tiff';
		break;
	case '.htm':
	case '.html':
		return 'text/html';
		break;
	case '.txt':
		return 'text/plain';
		break;
	case '.wav':
	case '.aud':
	    return 'audio/wav';
		break;
	}
}

Any time you add a new mime type you must add it hear the code is striaght forward

Now go to file_upload_process handler

Code:
$allowedMimeTypes = array(
				'application/pdf',
				'application/x-compressed',
				'application/x-gzip',
				'application/x-gzip',
				'application/excel',
				'application/msword',
				'application/vnd.ms-powerpoint',
				'text/html',
				'text/plain',
				'application/x-visio',
				'applicatioin/octet-stream',
				'application/postscript',
				'application/vnd.rn-realaudio',
				'application/vnd.rn-realmedia',
				'application/mpeg',
				'application/x-shockwave-flash',
				'video/quicktime',
				'fla',
				'image/tiff',
				'image/jpg',
				'image/bmp',
				'image/gif',
				'image/png',
				'application/x-troff-msvideo',
				'audio/wav',
				);

Replace your array with the one above it should then work.
Reply With Quote
  #6 (permalink)  
Old 01-02-2008, 10:35 AM
vib vib is offline
New Pligger
Pligg Version: 9.8.2
Pligg Template: none
 
Join Date: Dec 2007
Posts: 5
thnx, upload working
Reply With Quote
  #7 (permalink)  
Old 01-18-2008, 03:05 PM
Donor
 
Join Date: Aug 2007
Posts: 18
Quote:
Originally Posted by Redux View Post
you have to go to the file_process_upload handler

But first replace the get_mime_type function with this

{code}

Any time you add a new mime type you must add it hear the code is striaght forward

Now go to file_upload_process handler

{code }


Replace your array with the one above it should then work.


but i cant find the file names you mentioned
file_process_upload handler
get_mime_type function

sorry if i asked something wrong ....also find the error message attached to the post

site is Gudipudi / Published News and if needed you can try to upload the file and check the error message
Attached Thumbnails
[MOD] File Upload Module for 9.8.2 Is here for download :)-error.jpg  

Last edited by gudipudi; 01-18-2008 at 03:07 PM. Reason: forgot to include URL
Reply With Quote
  #8 (permalink)  
Old 01-27-2008, 09:21 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Does it work with v9.9 also ?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload Module (File and Image Attachment) Yankidank Free Modules 268 02-03-2012 12:19 PM
Index.php won't open to install nigelnix Questions and Comments 8 04-15-2010 06:19 PM
[MOD] File Upload Module (v0.1) -- Looking for testers cent Questions and Comments 54 06-11-2008 11:34 AM
[MOD] File Upload Module -- seeking requests for features cent Questions and Comments 2 08-11-2007 05:39 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development