Post by steppen321 » Thu Apr 07, 2011 9:34 pm

Hi,

few of my clients wants to have ability to upload swf banners.
I've modified /admin/view/javascript/ckeditor/config.js

From:

Code: Select all

['Image','Table','HorizontalRule']
To:

Code: Select all

['Image','Flash','Table','HorizontalRule']
Now i have swf upload button in CKEditor.

But...

When uploading SWF - editor says that this extension is not allowed.

Anybody could tell where I can add this extension to "whitelist"?

(Opencart 1.4.9.4)

Newbie

Posts

Joined
Mon Dec 13, 2010 11:32 pm

Post by steppen321 » Fri Apr 08, 2011 3:35 pm

Ok, I think I sorted out something on myself:

/admin/controller/common/filemanager.php

At line 95

Code: Select all

		if (isset($this->request->post['directory']) && $this->request->post['directory']) {
			$directory = DIR_IMAGE . 'data/' . str_replace('../', '', $this->request->post['directory']);
		} else {
			$directory = DIR_IMAGE . 'data/';
		}
		
		$allowed = array(
			'.jpg',
			'.jpeg',
			'.png',
			'.gif'
		);
added in array:

Code: Select all

		$allowed = array(
			'.jpg',
			'.jpeg',
			'.png',
			'.swf',
			'.gif'

At line 447

Code: Select all

				if ($this->request->files['image']['size'] > 300000) {
					$json['error'] = $this->language->get('error_file_size');
				}
				
				$allowed = array(
					'image/jpeg',
					'image/pjpeg',
					'image/png',
					'image/x-png',
					'image/gif',
					'application/x-shockwave-flash'
				);
Added one more "application/x-shockwave-flash"

Code: Select all

$allowed = array(
					'image/jpeg',
					'image/pjpeg',
					'image/png',
					'image/x-png',
					'image/gif',
					'application/x-shockwave-flash',
					'application/x-shockwave-flash'
				);

At line 461

Code: Select all

				if (!in_array($this->request->files['image']['type'], $allowed)) {
					$json['error'] = $this->language->get('error_file_type');
				}
				
				$allowed = array(
					'.jpg',
					'.jpeg',
					'.gif',
					'.png',
					'.flv'
				);
Added swf again:

Code: Select all

				$allowed = array(
					'.jpg',
					'.jpeg',
					'.gif',
					'.png',
					'.swf',
					'.flv'
				);

Seems to work to me, now I can upload and select swf files through CKeditor.
Please check if something was unnecessary or my modifications may cause any troubles on other aspects.

Newbie

Posts

Joined
Mon Dec 13, 2010 11:32 pm

Post by eastwood » Sun May 08, 2011 11:20 am

Hello,
I am new with this OpenCart business and was wondering where you go in order to manipulate the code to enable .swf files. I know I can download the .js files and manipulate them that way, but I don't know how to put them back in to OpenCart.

Newbie

Posts

Joined
Sat May 07, 2011 1:21 pm

Post by steppen321 » Sun May 08, 2011 8:55 pm

Hi,


search the web about "FTP protocol" or "FTP clients" (how to download/upload files from/to web sever).

or

Most web hosting companies provides online filemanagers, which allows uploading/downloding and even editing on place of files.

Newbie

Posts

Joined
Mon Dec 13, 2010 11:32 pm

Post by S_Hidd » Sat Jan 07, 2012 8:36 pm

not working vith oc 1.5.3 :'(
someone help me, please
thanks

Newbie

Posts

Joined
Mon Jan 02, 2012 7:44 pm

Post by phil-smiler » Thu Jan 12, 2012 12:02 pm

same here i get this error

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/m*****h1/public_html/cart/admin/controller/common/filemanager.php on line 448

Active Member

Posts

Joined
Tue Jul 12, 2011 5:17 pm

Post by Borealis01 » Tue Jul 30, 2013 5:28 pm

Hi i did this but it says

Notice: Undefined index: bits in /home/mysite.com/opencart/upload/system/library/image.php on line 16Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/mysite.com/opencart/upload/system/library/image.php on line 109Warning: imagedestroy(): supplied argument is not a valid Image resource in /home1/avemater/public_html/opalheart.com/opencart/upload/system/library/image.php on line 110

Newbie

Posts

Joined
Tue Jul 30, 2013 5:14 pm
Who is online

Users browsing this forum: No registered users and 40 guests