PLupload can add files but blocks when I choose to upload - gravity-forms-plugin

I am using Gravity Advanced Files uploader plugin for wordpress which use PLupload for file uploads.
I want it to allow .bmp and .dcm files to be uploaded. I was able to change the settings to allow those files types to be added with plupload by adding the file extension and also to the mime type list. But when I press start upload it comes back with those files as having a "file type error".

Resolved. The issue was actually the wordpress media library blocking those file types. I added this code to me funcitons.php file and problem solved.
add_filter( 'upload_mimes', 'my_myme_types', 1, 1 );
function my_myme_types( $mime_types ) {
$mime_types['dcm'] = 'application/dicom'; // Adding dicom images extension
$mime_types['bmp'] = 'image/bmp';
return $mime_types;
}

Related

Scala - Play downloads .html file instead of being opening it

I want to open an HTML file in the browser. All documentation/answers online suggest that the following is what I should have in my routes file:
GET /test controllers.Assets.at(path="/public/html", file="test.html")
Where test.html is located in public/html. However, when I go to /test, test.html is downloaded when I want it to just open in the browser (which I think is the expected behaviour of the .at function).
This has only started happening recently and no changes have been made to routes file or html file.
Any idea what might be causing this?
To serve an HTML file, you should have a Result. Results are defined within the controllers. For example:
def example = Action {OK(views.html.myhtml)}
Looks for the file myhtml.scala.html within the views folder. And here the controller method serves the result ok (http status 200) with that html file.
The asset folder is for ... well asset files which then can be used within the webpages: javascript/css/image files.

Save image with Tinymce

I implemented Tinymce on a website and it's being used as a content editor by the owner of the website (the content is saved in a .txt file). I would like to know if it is possible to save an image uploaded in the tinymce editor into a specific folder on the server.
Thanks!
You'll be able to choose a specific location for image uploading using the images_upload_url property. You can read more on that and our Image Uploading API here: https://www.tinymce.com/docs/configure/file-image-upload/

Play Framework - only getting file content from Ok.sendFile(file)

My users need to download a file when hitting a certain controller in my Play application. I thought this would do the trick:
def downloadFile = Action {
Ok.sendFile(new File("example.zip"))
}
But it seems to only give the actual content of the file instead of downloading the file. Could anybody tell me what I'm doing wrong?
Thanks
Try this instead:
def index = Action {
Ok.sendFile(
content = new java.io.File("/tmp/fileToServe.pdf"),
fileName = _ => "termsOfService.pdf"
)
}
Its from the documentation itself.
Now you don’t have to specify a file name since the web browser will
not try to download it, but will just display the file content in the
web browser window. This is useful for content types supported
natively by the web browser, such as text, HTML or images.
See this: https://www.playframework.com/documentation/2.0/ScalaStream
Turns out the REST client we are using is automatically converting the file straight into its content instead of letting us download the file. Hitting it from a normal browser works as intended.

Debugging Responsive File Manager Plugin (TinyMCE)

Yesterday I found this great looking plugin for file and image management for tinymce however I cannot get the files to actually save to the drive. I have tried every commbination I can think of.
responsivefilemanager.com - This plugin.
Anyone used it before and know of the settings I might need?
The plugin sits here: /public_html/cms/app/webroot/js/tinymce/plugins/filemanager
I'm trying to set it up so the uploads go here: /public_html/cms/app/webroot/files/cms
The config file for the plugin has 3 lines to configure for this, these are as follows and as I have set them up:
$base_url="http://domain.com/cms/"; // base url of site. If you prefer relative urls leave empty
$upload_dir = 'app/webroot/files/cms/'; // path from base_url to base of upload folder
$current_path = '../../../files/cms/'; // relative path from filemanager folder to upload folder
Now when I started working this out I would get an error for the plugin saying the root folder doesn't exist so I keep playing with the paths and now I don't get this error but I still cannnot get it to upload the images, everything looks like it works, I get the preview as the image is uploading and a green tick once it's complete then I go back to the files list and the image isn't there. It's not on the server either. I'm wondering if there is a way to debug this and work out what's happening?
Thanks
I ended up getting this to work with the following settings:
$base_url="http://domain.com"; // base url of site.
$upload_dir = '/cms/app/webroot/files/cms/'; // path from base_url to base of upload folder
$current_path = '../../../../files/cms/'; // relative path from filemanager folder to upload folder
Thanks
Try the following settings if you still have not got this sorted out yet:
$base_url="http://www.domain.com/cms"; // base url of site. If you prefer relative urls leave empty --> No trailing slash
// The upload directory will be a dir you have created for the files to be uploaded to, ie: localhost/cms/app/webroot/files/cms --> this file must have write permission.
$upload_dir = '/app/webroot/files/cms/'; // path from base_url to base of upload folder --> write permission (chmod = 755)
$current_path = '../../../../files/cms/'; // relative path from filemanager folder to upload folder (you are missing one "../")
// The thumbs folder located in tinymce/plugins/filemanager/thumbs must also have write permission (chmod = 755)
That should do it
use gsynuhimgupload plugin TinyMCE
http://gsynuh.com/tinymce-simple-image-uploader/136
TinyMCE simple image uploader
Here’s a repost of my TinyMCE image uploader plugin. It used to be on gsynuh-labs.com (but I let this domain go).
please note that this plugin is no longer supported by me – and I’m not responsible for any inconvenience caused by it, it is shared “as-is” and you have to be responsible when using it ie: take care of any possible injection problems/security problems in your own site’s context.
I’m not interested in expanding it myself as I was only looking for a very minimal image uploading plugin for myself but If you are going to expand on it, I can list your version on this page if you want, just contact me.
—

Recognize my mime type without file extensions on iOS

I am writing an application that needs to recognize my custom mime type so that when such file is downloaded from a server my application will be launched. I read the great article of Brad on how to write a mime type recognizer under iOS at How do I associate file types with an iPhone application? and it works well if and only if the extensions of the file is also specified in the UTExportedTypeDeclarations / UTTypeTagSpecification section of my plist and the server serves the files with the same extension. If the server serves the file with a different extension or if no extensions are specified in the plist but the mime-type is matching, the following happens:
The browser (or the application that received the file) shows the correct icon of my file type with the correct [Open in myApplication] button but clicking on the button does nothing, my application is not launched and if it is running, no application:openURL:sourceApplication:annotation: message is sent.
Is there any way to write a file type recognizer based only on the mime-type, without a specific file extension?
this has been answered, you'd want to use NSURLRequest, this will allow you to get to the mimeType which you can use to determine the file extension as needed. the full code and additional hints and tips are available at this post:
https://stackoverflow.com/a/1401918/728261