Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[FileUpload Addon] Selected 'Insert Image' after upload, no feedback to user?
Once an image has been uploaded, I press the 'Insert Image' button but receive no feedback (i.e. I don't see the image inserted into my post). It's not until I submit my post that I can see the image. I'm using FF 3.6.1.
Anyone else experiencing this? Everything else is working fine for me.
Anyone else experiencing this? Everything else is working fine for me.
Tagged:
1
Comments
If you turn off tinyMCE and CLEditor, at least you can see that the image tag is inserted.
Still, it would be very nice if the plugin could work together with thesere WYSIWYG editors.
When you upload a file, at first it is stored to uploads/FileUpload/scratch with a temporrary file name (something like "fresh-54792e6b0d6aa5aa2507c35ec292f914-1296745994.4629.jpg"
When you click "insert image" it inserts an - Tag into the editor which already links to the final image directory (like uploads/FileUpload/7/7.jpg.
Problem is that the image file is moved to the new path when the Comment is posted.
When I've time I will try makeing up something...
I got this to work... Well it still needs some work but it functions I'm using FileUpload and CLEditor. It's really late and I might be missing something here but it's at least a head start! I amended FileUpload\js\fileupload.js from line 516:
//txtbox.val(txtbox.val()+'');
txtbox.val(txtbox.val()+'');
try { success = ed.doc.execCommand('insertimage', 0, gdn.url('discussion/download/'+MediaID+'/'+Filename) || null); }
catch (err) { description = err.description; success = false; }
if (!success) {
if ("cutcopypaste".indexOf(command) > -1)
showMessage(editor, "For security reasons, your browser does not support the " +
command + " command. Try using the keyboard shortcut or context menu instead.",
button);
else
showMessage(ed,
(description ? description : "Error executing the " + command + " command."),
button);
}
The img source for the link is now pointing to the uploaded file, and not the copy that will be created when the post is being submitted (as noted by @CrazyBird). Not sure if it's nescesary to have these duplicate files (one for the upload and then also a copy for the image added to the body?!)
Secondly, call the CLEdit execCommand function to update the image link and have it displayed in the iframe.
If I think if something I missed I'll let you know
I hope this helps someone!
Thx,
Ian
at first the image shows up in the editor when clicking "Add Image", but when i save the changes, there is no photo in the discussion message.
tested it with a text and behind that a png- image.
Fatal error: Class 'PermissionException' not found in mysite/public_html/plugins/FileUpload/class.fileupload.plugin.php on line 320
So when I comment out
if (!$this->CanDownload) throw new PermissionException("File could not be streamed: Access is denied");
it works but I would like it if when the picture is clicked the original is viewed instead of downloaded. Is avoiding that the thing that was causing this in the first place?
(server url)/discussion/download/3/240z.jpg
... Insert Image doesn't do anything with CLEditor enabled, and only inserts a download link when using the HTML editor. I have not looked at the code yet, but I'm curious as to whether or not anyone can confirm a fix.
Also, I noticed if I save the post with an attachment, and then come back to edit the post and move the attachement around within the post, it will break the attachment and it won't show any longer.
Are there any plans to update this mod to address these issues?
Chris
Thanks for your patch. I tried it, but it didn't work because "jResponse" is written with a lowercase "j" for the "insertImage" command.
I modified some other things, e.g. inserting the full image in the editor area instead of the thumbnail.
I came up with the following version: Christian
https://github.com/vanillaforums/Addons/issues/22