How to get the file upload button to show in the EditMe extension - yii

I'm using the ExtEditMe extension in my project with the following configuration:
$this->widget('ext.editMe.widgets.ExtEditMe',
array(
'model'=>$model,
'attribute'=>'Text',
'ckeConfig'=>array('enableTabKeyTools'=>true,'enterMode'=>2),
'height'=>'500',
'width'=>'100%',
'filebrowserImageBrowseUrl'=>'/protected/extensions/kcfinder/browse.php?type=files',
'filebrowserImageUploadUrl'=>'/protected/extensions/kcfinder/upload.php?type=files',
'filebrowserBrowseUrl'=>'/protected/extensions/kcfinder/upload.php?type=files',
'filebrowserUploadUrl'=>'/protected/extensions/kcfinder/upload.php?type=files'
)
);
For some reason the file upload button isn't showing in the tool bar. Is there something else I need to add?

Questions too much for a comment. Could you check the following:
Check the permissions for the assets folder. Need to be writable by your
httpd (example apache:apache or apache:www-data)
EditMe should be inside the protected/extensions/ folder
Change your widget call to:
$this->widget('application.extensions.editme.widgets.ExtEditMe',
(used full path)
Check if kcfinder/config.php says: 'disabled' => false,
Also, there may be a need to put kcfinder in the root of the webapp. See this example with CKeditor.

The following comes from the CKEDITOR docs:
This button will be hidden by default (hidden:true). The filebrowser plugin looks for all elements with the filebrowser attribute and unhides them if appropriate configuration setting is available (filebrowserBrowseUrl/filebrowserUploadUrl).
Which could mean your config settings for the filebrowser plugin are not correct. You should try the following:
KCFinder (your filebrowser plugin) is not a yii extension as far as I know, so move the kcfinder folder to the root folder (or any other folder outside of the protected folder).
Change the paths to the KCFinder files. I recommend using yii's Yii::app()->baseUrl to make sure you're getting the correct paths:
'filebrowserImageBrowseUrl'=>Yii::app()->baseUrl.'/kcfinder/browse.php?type=files',
'filebrowserImageUploadUrl'=>Yii::app()->baseUrl.'/kcfinder/upload.php?type=files',
'filebrowserBrowseUrl'=>Yii::app()->baseUrl.'/kcfinder/upload.php?type=files',
'filebrowserUploadUrl'=>Yii::app()->baseUrl.'/kcfinder/upload.php?type=files'
Hope that helps.

'filebrowserImageBrowseUrl'=>'/protected/extensions/kcfinder/browse.php?type=files',
'filebrowserImageUploadUrl'=>'/protected/extensions/kcfinder/upload.php?type=files',
'filebrowserBrowseUrl'=>'/protected/extensions/kcfinder/upload.php?type=files',
'filebrowserUploadUrl'=>'/protected/extensions/kcfinder/upload.php?type=files'
These URLs will be passed to the Javascript initiator of the extension, and they will be requested from there, so you can copy them and try requesting them from the browser to see if they are working (I'm almost sure they won't work).
One way you can work this out, is by creating a controller and includes these PHP files there, then make these URLs refer to the controller you created. Hope it helps.

Related

Where to install 3rd party scripts in Nuxt?

Im trying to upload static files(images and js) from "static" folder. And it works fine for index file and base route localhost:8000/, but if I go to the next route localhost:8000/reviews/master001 then static files disappears and I receive by route localhost:8000/reviews/js. And there is two things, first is how to remove prefix "reviews"?
I tried to use in nuxt.config.js
static: {
prefix: false
}
by documentation, but it does not work. Tried to use paths in nuxt.config like "../js", "#/static/js", "/js" - this one works for index file.
Also there are no any static files after I go through the router-link such it in nuxt documentation for path localhost:8000/reviews/master001.
Here there are.
And here there no any files.
As explained in the comments above, images should be in assets and static is only aimed for specific use cases, like exposing a publicly accessible .pdf file.
If you want to install and use jQuery properly into your Nuxt project, you can follow my answer here: https://stackoverflow.com/a/68414170/8816585
If you want to load a specific script and cannot do it in a more cleaner way (with NPM), you can also follow the instructions there: https://stackoverflow.com/a/67535277/8816585
Use this as a last resort tho and be aware that it will increase bundle size and loading time.

Images uploaded in Vue.js production mode not showing

I am a bit new to Vue.js. I am doing a social media application that allows users to upload and share images with others. I store my images in src/assets folder during development. However, when I build the project, all images are put in the dist folder. Therefore, what can I do to enable users to still upload images on production? Do I create the assets directory in the dist folder?
I have since tried different ways, including storing images on the backend. In dooing this, I reference the backend path relatively, using, for example, ../../../backend/public/assets..., and it works on development. However, when I build, the images that existed in the backend directory at the time of building are visible, however, whenever I try uploading more on production to the ../../../backend/public/assets... directory, they are uploaded successfully but are not visible (that is on production). I get an error that Cannot find module './image_name.image_extension'.
What am I doing wrong?
I have seen similar questions like this but there was no answer.
You must set your public path and change your way!!
first step to do is creating vue.config.js in your root directory, if you want to know more details, read this: https://cli.vuejs.org/config/
for example, I define prefix path for my files:
module.exports = {
publicPath:
process.env.NODE_ENV === "production" ? "/" : "/",
};
remember, It's better if you use "#" to define your paths.
for example, if you want to load a image which located in src/assets/files/img/myImage.png, you can use #/assets/files/img/myImage.png in template section for binding or script section of your .vue files!
It always help you to find correct path of your files.
and finally your way is not standard because "src/assets/..." will used for compiled scripts and styles and also your files which you want to use on your UI layout like static images. so you have to use "public/assets/..." directory to save your file, then you will see everything is going well for you.
if you have a more question or stuck solving this problem again, I'm here to fix your issues.

Laravel wrong public path file upload

I've deployed laravel with this guide.
http://juniorgrossi.com/deploying-laravel-applications-on-a-shared-host/
On my webserver I have a public_html file now containing all my publicly accesable files and a laravel folder containing the rest, so I've split up the default laravel structure for deployment.
On my development server by default the public folder is resting inside the laravel folder instead of being on the same directory level.
The problem I'm getting though is when I use something like this:
// Upload the file
Input::upload('image', 'public/uploads', $filename);
Same with this.
// Upload the file
Input::upload('image', path('public') . 'uploads', $filename);
Instead of trying to use the uploads folder that is inside my public_html folder it tries looking for a public file inside my laravel folder now.
And I get a
Unable to create the "/uploads" directory
Ofcourse on my development server the public folder is still inside the folder so it's logical.
How do I fix this?
You may try this (add a slash after the folder name)
Input::upload('image', path('public') . 'uploads/', $filename);
Maybe try this....just as a test
Input::upload('image', URL::to_asset('uploads/'), $filename);
You can also try
Intervention/image package.
I'm using this and I find it very easy to use. It also has a resize and crop feature.
It's easy as:
Image::make(Input::file('file')->getRealPath())->save('uploads/' . $filename);
Fixed the paths.php to ../public_html
I've done this before but it failed since I accidentaly uploaded a png and my jcrop function wich crops and saves images failed because it currently onlt takes jpg. So that left me thinking my paths.php settings were no good while they actually were.
Thanks for helping out though everybody!
(I feel like a fool.)
In my case, I got the same problem. Then I created it manually, CHMODed the lil' bastard and it worked fine!
Making a long history short (not so long...): just permission!
If you have the permission to Write/Read to the folder, you'll be cool! If you don't, you change the permissions! If you are unable to change it, put the uploaded files where the permissions allows you to access the file.

Rails 3.1 serving images from vendor/assets/images

I am trying to put some external images (used by a jQuery plugin) to vendor/assets/images in my Rails 3.1 app. Problem is that when I try something like:
<%= image_tag "ui-bg_flat_75_ffffff_40x100.png" %>
I get an error:
No route matches [GET] "/assets/ui-bg_flat_75_ffffff_40x100.png"
I checked my Rails.application.config.assets.paths and it list these dirs:
..../app/assets/images
..../app/assets/javascripts
..../app/assets/stylesheets
..../vendor/assets/images
..../vendor/assets/stylesheets
..../.rvm/gems/ruby-1.9.2-p180#mygems/gems/jquery-rails-1.0.9/vendor/assets/javascripts
As you can see /vendor/assets/images is listed there. If I put my image to app/assets/images everything works.
I thought that new asset pipeline was supposed to go through all assets dirs and serve requested file wherever it finds it.
Does anyone knows what's the problem here?
I had to restart my rails server after creating the vendor/assets/images directory. Before this, I was seeing the same error as you ("No route matches [GET]").
My guess is that the rails server does not check these directories if they did not exist when it was first started. When you open a rails console to diagnose the issue, you get a new instance of rails which knows about the directory, which only adds to the confusion.
If you are using a jQuery UI Theme Roller theme then the problem might be that in the jquery-ui css file the images are referenced within a sub folder 'images'.
I.e. you either have to put your images in a folder './app/assets/images/images' or you have to edit the jquery-ui css file and remove the 'images/' folder prefix.
The asset pipeline is described in this rails guide by Ryan Bigg (draft status at the moment).
http://ryanbigg.com/guides/asset_pipeline.html and http://ryanbigg.com/2011/06/sprocket-asset-tags-internals/ for the references.
According to this, your example should work.
Extract:
Assets can be placed inside an application in one of three locations: app/assets, lib/assets or vendor/assets.
app/assets is for assets that are owned by the application, such as custom images, javascript files or stylesheets.
lib/assets is for your own libraries’ code that doesn’t really fit into the scope of the application or those libraries which are shared across applications.
vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins.
Any subdirectory that exists within these three locations will be added to the search path for Sprockets (visible by calling Rails.application.config.assets.paths in a console). When an asset is requested, these paths will be looked through to see if they contain an asset matching the name specified. Once an asset has been found, it’s processed by Sprockets and then served up.
I have tested with an example in my app and the same syntax as yours works. Maybe you have a typo in the name of your asset.
For Martin: search path for Sprockets is visible by calling Rails.application.config.assets.paths in a console.
Maybe you should create another folder in /assets/images. You make a name 'images' and then you just copy all jquery-ui image and paste on folder 'images' that you create before. Hopefully this will help you.

how to install new oracle apex theme?

I'm trying to install new apex theme but the problem is that I don't know where to put theme images folder in apache webserver?
I tried to put it on the apache/images but this doesn't work
So does anybody know where to put the images folder
Note: I have successfuly imported the .sql file and already switched the theme to the new one.
It depends on how the template references the image files.
By default in Apex, there is a substitution value called #IMAGE_PREFIX# that points to a folder called /i/. This folder, in turn, is just an alias set up in the Apache config (see the dads.conf file to determine the actual location).
Your template should reference images using #IMAGE_PREFIX#some_folder_name/some_file_name, in which case you need to put the images in a folder called "some_folder_name" beneath the directory that the /i/ alias points to.