OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



test upload file image createIssue

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

test upload file image createIssue

Postby cristianviza » Fri Aug 23, 2013 1:42 pm

Hello community.
how are everybody? I need a advice :) .
I modify the file /templates/editor/issues/createIssue.tpl , to read that you can only up .png file
Image
also modify
/classes/issue/form/IssueForm.inc.php
/lib/pkp/classes/file/FileManager.inc.php -> getImageExtension2($type))
but I would you like also limit size of image upload (width,heigth) pixels , i try use list($width, $heigth, $tipo, $atributos) = getimagesize($ss) however $width return emtpy, I though because $ss is incorrect.
That variable records the patch to plain, unformatted you select? or in what way do I recommend that desire control.
Regards
Code: Select all
   if ($publicFileManager->uploadedFileExists('coverPage')) {
         $type = $publicFileManager->getUploadedFileType('coverPage');

         if (!$publicFileManager->getImageExtension2($type)) {
            $this->addError('coverPage', __('editor.issues.invalidCoverPageFormat'));
            $this->addErrorField('coverPage');
         }
         
         //control size
      $FilePath=$publicFileManager->getUploadedFilePath('coverPage');
         $FileName=$publicFileManager->getUploadedFileName('coverPage');
         $ss="img/".$FileName;
                                         //try getimagesize
      list($width, $heigth, $tipo, $atr) = getimagesize($ss);
      
                      if ($width<100) {
                      $this->addError('coverPage',"the width is < 100px, please upload other imagen");
            //$this->addError('coverPage', __('editor.issues.invalidCoverPageFormat'));
            //$this->addErrorField('coverPage');
         }
      }
cristianviza
 
Posts: 74
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: test upload file image createIssue

Postby asmecher » Mon Aug 26, 2013 3:17 pm

Hi Cristian,

Off the top of my head, I think the "img/" prefix is wrong -- try removing it?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8599
Joined: Wed Aug 10, 2005 12:56 pm

Re: test upload file image createIssue

Postby cristianviza » Wed Aug 28, 2013 1:59 pm

Thanks for you response. You are right asmecher.

Regards Cristian
cristianviza
 
Posts: 74
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest