Coder Social home page Coder Social logo

Uploaded media not available in UI about scalar HOT 14 CLOSED

anvc avatar anvc commented on July 22, 2024
Uploaded media not available in UI

from scalar.

Comments (14)

craigdietrich avatar craigdietrich commented on July 22, 2024

Hi!

Do you mean, the choose an image pulldown for choosing a key image or background image?

Those pulldowns determine what is an image in a rather strict way, the file extension of the uploaded files need to be .jpeg, .jpg, .gif, or .png. So, if your images don't have one of these extensions, or don't have any extension (which can happen on a mac), then they won't show up in the list.

Curious if this helps?

from scalar.

aaron-collier avatar aaron-collier commented on July 22, 2024

My book is called "test" and this is my media folder:

total 80K
drwxrwxr-x 2 apache www    4.0K May 10 15:37 .
drwxrwxr-x 3 apache www    4.0K May 10 15:15 ..
-rwxrwxr-x 1 apache apache  22K May 10 15:37 book_thumbnail.png
-rwxrwxr-x 1 apache apache  22K May 10 15:36 scholarworks.png
-rwxrwxr-x 1 apache apache  22K May 10 15:36 scholarworks_thumb.png
[root@ip-172-31-21-86 html]# 

So not sure why they aren't loading.

from scalar.

aaron-collier avatar aaron-collier commented on July 22, 2024

FYI - When I "Import Local Media File" - the upload works, the file shows up on the filesystem, but the UI doesn't indicate any success or failure, it just stays on the import page. So maybe something related to this is the problem?

from scalar.

craigdietrich avatar craigdietrich commented on July 22, 2024

Ah, so when you try to upload a file, the upload page doesn't refresh to a new page that shows the image, once the upload is complete?

When you go to Dashboard > Media tab, do you see anything listed there?

What Scalar install are you using? One of ours (e.g., scalar.usc.edu) or a custom install?

from scalar.

aaron-collier avatar aaron-collier commented on July 22, 2024

Right.

This is a fresh install from git master.

from scalar.

craigdietrich avatar craigdietrich commented on July 22, 2024

When you go to Dashboard > Media tab, do you see anything listed there?

from scalar.

aaron-collier avatar aaron-collier commented on July 22, 2024

Nope.

from scalar.

craigdietrich avatar craigdietrich commented on July 22, 2024

Are you familiar with the Web Inspector in your browser? If so, could you open it up and click on the Console tab? This will reveal the ajax request to the server (that comes back after the file is physically uploaded), in which case can you check to see what is returned and if there's any javascript or php error in there?

If the above is out of your league I can try to cook up a lighter weight option.

Either way there's probably a PHP error being thrown for some reason by your server, probably to do with permissions or something.

from scalar.

aaron-collier avatar aaron-collier commented on July 22, 2024

The validation javascript is certainly failing. Getting a null result. The apache user is the owner of the file system structure, so not sure why a permissions issue would be a problem unless it's doing something outside of the app filesystem structure.

from scalar.

craigdietrich avatar craigdietrich commented on July 22, 2024

Are you able to open up the request itself (might be under the Net tab)? If so, under the "Response", you should see something, maybe some PHP errors? Or, is the Response itself just blank?

If the response itself is blank, you can open up codeigniter.php in the root folder and switch "production" to "development" and try again: this should turn on errors.

from scalar.

aaron-collier avatar aaron-collier commented on July 22, 2024

Ah, thanks... getting somewhere. I have this error:

PHP Fatal error:  Uncaught Error: Call to undefined function imagecreatefrompng() in /var/www/html/system/application/libraries/File_Upload.php:139\nStack trace:\n#0 /var/www/html/system/application/libraries/File_Upload.php(43): File_Upload->resize('/var/www/html/t...', 200)\n#1 /var/www/html/system/application/controllers/book.php(541): File_Upload->createMediaThumb('test/', 'media/scholarwo...', 509)\n#2 /var/www/html/system/application/controllers/book.php(167): Book->upload()\n#3 /var/www/html/system/core/CodeIgniter.php(326): Book->_remap('test', Array)\n#4 /var/www/html/codeigniter.php(203): require_once('/var/www/html/s...')\n#5 {main}\n  thrown in /var/www/html/system/application/libraries/File_Upload.php on line 139, referer: http://scalar.calstate.edu/test/upload

from scalar.

craigdietrich avatar craigdietrich commented on July 22, 2024

Ah! That's it!

Do you have access to PHP on your server? The GD Library needs to be turned on http://php.net/manual/en/book.image.php

I think thumbnail creation is the only operation that uses GD (though there's a few places that thumbnails are made).. if you can't get GD turned on I could put in the pipeline some hooks for Scalar to test whether those functions exist before trying to use them, which would remove those errors.

from scalar.

aaron-collier avatar aaron-collier commented on July 22, 2024

FIXED!

Thanks! Was that in the docs? I missed it. That should probably be highlighted.

Thanks again!

from scalar.

craigdietrich avatar craigdietrich commented on July 22, 2024

Great idea, done! 01e291d

Thanks for sticking with it!

from scalar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.