Jump to content

[Resolved] Changed the max file upload size but still wont work


trivstar

Recommended Posts

I am new to cubecart and am struggling to customize. I am trying to upload photos (without having to upload directly through my hosting) and i have configured filemanager.class.php as follows:  

class FileManager {
	private $_directories;
	private $_mode;

	private $_manage_cache;
	private $_manage_dir;
	private $_manage_root;
	private $_recently_uploaded = array();
	private $_sub_dir;
	private $_sendfile = false;
	private $_max_upload_image_size = 50000;

	public $form_fields = false;

	const FM_FILETYPE_IMG 	= 1;
	const FM_FILETYPE_DL 	= 2;

	const FM_DL_ERROR_EXPIRED 	= 1;
	const FM_DL_ERROR_MAXDL 	= 2;
	const FM_DL_ERROR_NOFILE 	= 3;
	const FM_DL_ERROR_NOPRODUCT = 4;
	const FM_DL_ERROR_NORECORD 	= 5;
	const FM_DL_ERROR_PAYMENT 	= 6;

	##############################################

However i am still unable to upload files over 350kb. (and i have made sure to save my edits)

Link to comment
Share on other sites

Welcome trivstar! Glad to see you made it to the forums.

If you are using the "dropzone", that feature is javascript powered and is set to allow only '0.35' MB file sizes. You can see this in the admin skins folder, js/admin.js, near line 320.

You would need to change that. (Then, you may also want to change the wording that mentions the limit size. We can work on that later.)

Once past that, then the FileManager class needs changing. You changed the _max_upload_image_size, but I see that you may be a short one zero of the desired limit.

Because the javascript has changed, you will need to force your browser to reload the page resources (CSS, javascript, images). This is usually done with CTRL-F5.

Link to comment
Share on other sites

I got this same problem.
Where you able to solve this trivstar?

I have changed the  private $_max_upload_image_size to 500000
however I dont find the 0.35mb limit in the admin.js file probably since i'm not using dropzone.

Anyone that knows how to increase the image size upload limit?

Link to comment
Share on other sites

Is it that you don't use dropzone, or are you using a version of CubeCart that does not have dropzone?

When you are advised that an image exceeds the filesize limit, at what point do you get this warning? On the next page showing in a red banner? Or a javascript alert box immediately when you click Save on the upload form?

 

Link to comment
Share on other sites

Thanks for the fast reply bsmither.
I was looking in the wrong admin.php file, but found the right one and changed the limit to maxFilesize: '2.55',

But it still does not seem to work.
I don't get any warning and the file seems to upload fine when I add it to the dropzone.
However it never get's listed in the file list. I tried reload the page etc but the files does not seem to get uploaded.
(Everything smaller than 350 works fine)

By the way I'm using latest version of CC.

Link to comment
Share on other sites

You say the file seems to upload fine once dropped onto the dropzone.

Within your hosting account's control panel, File Explorer, can you find the file that was just uploaded? (You can do this also by using an FTP client.)

Using an external utility such as phpMyAdmin (also found as a tool in your hosting account's control panel), can you find the file that was just uploaded in the CubeCart_filemanager database table?

You don't get any warning. That's strange.

Having edited the admin.js file, be sure to force your browser to reload the page's resources (CSS, javascript, images) This is usually done with CTRL-F5.

Link to comment
Share on other sites

No the files does not exist on the server when I browse the images/cache with FTP.
Also looked in the database and the files have not been added there.

Yeah its strange since the file seem to upload fine without any warnings after dropping them into the dropzone.
Do think there is any additional files that also needs to be edited?
Or should this work just editing the admin.php file and  filemanager.class.php

Link to comment
Share on other sites

  • 2 weeks later...

Seems like I got this working now!
This is how I made  my filemanager.class.php file to look like:

class FileManager {
    private $_directories;
    private $_mode;

    private $_manage_cache;
    private $_manage_dir;
    private $_manage_root;
    private $_recently_uploaded = array();
    private $_sub_dir;
    private $_sendfile = false;
    //private $_max_upload_image_size = 350000;
    private $_max_upload_image_size = 6291456; // 6MB

    public $form_fields = false;

Thanks!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...