TinyMCE5 not uploading images on drag-n-drop - file-upload

I'm looking at this documentation on "Image and file upload options".
First thing off the bat it says in describing the automatic_uploads option is:
Enable or disable automatic upload of images represented by data URLs
or blob URIs. Such images get generated, for example, as a result of
image manipulation through Image Tools plugin, or after image is
drag-n-dropped onto the editor from the desktop.
This is exactly what I want - when an image is dragged and dropped onto the editor I want it to upload the image to my server. I read through the rest of the options and came up with this:
tinymce.init({
automatic_uploads: true,
images_reuse_filename: true,
images_upload_credentials: true,
images_upload_handler:async function (blob,success,failure) {
console.log(blob)
},
// remainder of options here
For the moment I'm just trying to print a debug statement when the upload handler is called, so that I know I have gotten that far. But when I drag an image onto the editor, I get a pop-up which says:
Leave site?
Changes you made may not be saved.
[Cancel] [Leave]
If I say "Leave" it abandons the site and brings the image up in the browser, which is not what I want. If I say "Cancel" then it stays on the page, but my upload function is never called, and subsequent attempts to drag onto the page do nothing.
Why isn't this working? Is there some plug-in that I need to install which isn't mention on the documentation page?

How a browser treats dragged/dropped images can differ across browsers. From where are you dragging the image? What browser and OS are you using?
In TinyMCE 5 the Insert/Edit Image dialog would have an Upload option (3rd link on the left) if you have image uploads setup correctly.
Do you see such an option? Can you drag/drop to that dialog via the Upload tab?

Related

How to edit and save a PDF in Firefox 107 with JavaScript?

With the latest version of Firefox (107) it is now possible to edit and sign PDF documents within the browser preview window.
But how can I upload an updated version of such a PDF file back into my Web Application?
Is there any kind of JavaScript API I can use?
There is much overlap between PDF web editing browsers and Browser editing PDFs
the data is pulled down locally and the binary application edits the data however for a PDF, that then requires a local save as a new combined PDF. here we can see a visual reminder.
In Firefox or Chrome there are slight differences but the core need is to resave the PDF as a clients local file.
Chrome has inking
And Firefox uses a slightly different overlay but again the conjoined local data must be first saved as a new PDF.
either by print
or the top right Save (again) AS
Thus to achieve your goal you need to ask the annotator user to upload their masterpiece. However you cannot easily do that in the sandboxed page (with work frame) it needs to be after a user signal such as press button here to upload where-ever IF you were able or bothered to save as a new pdf.

Display the pdf through a link in database

I am working presently on the adf side and I am stuck with some issues.
I have a page where I have to display the pdf files. The pdf files are in another site and the links are present in a column of the database.But when I try to access those links they are downloading rather than displaying. I need to display those pdf files in my inline frame rather than downloading.
I heard many suggestions like write a bean and put the file in session and get display them in page .But I am not clear.
So please help me on this.
I have a check box at the end and the checkbox should be enabled in my page only when the displayed pdf scrolled to end.
Please help me solving those issues.
When you create a link to a PDF there is only so much you can do to make it display in the browser. The most important thing you must do on the server that delivers the PDF is to make sure it is presented with the correct MIME-type and without a content-disposition header value of attachment.
After that, it's up to the browser to either show it in a browser tab or to download the file. I know Chrome will show the PDF in the browser when it's linked to, not sure if it also does that when it's linked in an iframe.
I don't think there's a reliable way to make it work the way you want, simply because it's very browser dependent.

Moodle PHP filehandeling

My problem is that we have made an block that opens a page witha a mform on it. And we use the editor element to start the tinyMCE editor, on the page. But when we save the output, the images oploaded to the text field is only viewable to the admin (the person who uploaded it) and in the mdl_files it sets it to be a draft file. I have been through the documentation, and i might have lost the context on the new page, but im not sure.
In Moodle, files uploaded to a form (either to a filemanager element or a text editor) are stored in a temporary 'draft' area while the form is being edited.
This is so that the actual files are not changed until the form is submitted (e.g. if an admin changed the image embedded in some text, deleting the original, you do not want anyone viewing the page during the editing to see a broken image link).
When working with files embedded in a text editor in Moodle, you need to make sure you copy all existing files into the 'draft' area before you show the form, then copy the 'draft' images into the real area, after the form is submitted.
See https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#editor for details about how to do this.
Please also note that your plugin will also need a PLUGINTYPE_PLUGINNAME_pluginfile() function in its lib.php, in order to authenticate any file requests from the user's browser and return the file contents. See any of the core activities for examples of this (e.g. mod/data/lib.php - function data_pluginfile()).

Is it possible to have a hyperlink open in a new tab that is inside a pdf that is inside of a frame in classic asp?

I Have a classic asp site i am working on. The page has two frames one directly below the other. A Customer has to be able to view a pdf to continue onto the next page. To get to the next page they have to click on a hyper link inside of the pdf that is being viewed. If they cannot see the pdf then they have to download adobe reader which i have included a link to in the top frame.(The top frame has some text and the link) now the bottom frame(contains the pdf) this works fine except when i click the link that is in the pdf the page then opens in that same bottom frame that contained the pdf. It needs to be target _blank. Or whatever you would call it to basically either over ride the two frames and just open in the browser or open in a new tab or window which i cant get either to do. This problem is in IE and Firefox but in chrome it over rides the two frames and opens correctly. Is there any way to get this to occur in IE and Firefox?
I've found this resource about your issue:
http://forums.adobe.com/thread/853394
They say there's no target attribute to set. But they think (and i also think) that if you place a :
javascript:window.open('http://yoururl.com');
it should work, always if you can accept the security alert message (Abobe PDF is trying to execute a script... blah blah)
If your continue reading carefully it seems they solved the problem using Adobe scripting inside inDesign
Hope this helps...

How to show PSDs online without letting others download it?

I have around 20 PSDs which I need to show to a few programmers. Is it possible to upload them somewhere where they can view them but not download?
Or only option is to convert all of them to JPGs one by one?
Thanks
You can use google docs to view .psd online. Upload it to docs.google.com, select the file to view, then before sharing click "File" and toggle "Prevent viewers from downloading"
Use Photoshop actions to batch convert many psd's to jpgs and upload the jpg's. If you fear that they can misuse jpg's too, add a watermark over your jpg images.
Pipeline to do this could be:
Window -> Actions
Open your PSD file
click, in Actions window, on the button in lower right corner "create new action"
Name your action
Click Record
Your actions are now being recorded.
Layer->Flatten image (take care now - not to accidentaly save your PSD as flattened!)
If it is an cmyk, convert it to rgb,if it has bleed, crop off the bleed part
Resize your image if needed image -> image resize
File -> save as...JPG
Close image
Stop recording action.
Now you can run that action on whole folder where your PSD-s resides:
File -> automate -> Batch
Choose your action, and chose your folder.
Choose your source folder... twaeak a little... and magic will start to happen!