If the server sends back information about the file, including the file name, then yes, you could get it that way - ...file( 'files', field ).fileName for example. This depends on what is being stored in the database though.
In terms of events, actually no. It triggers events once the file has been uploaded, but not prior to the upload.
I am using an editor and have added a CKEditor to edit one of the fields.
Within the CKEditor I am adding the images that I upload. So I cam have a field with all the information in.
So at the moment once an image has been uploaded I right click the thumbnail get the new file image url and manually add that in the ckeditor.
My aim is on new file upload.
Get the existing data in the CKEditor.
Add the new file ( with the necessary <scr added to display it )
Update the CKEditor then manually 'fluff' up the layout.
This is how I am getting the details column here www.surplusanywhere.com/surplusAnywhere6 which I then offer a button so the client can email that particular deal to themselves ( eventually )
PS I just noticed I can drag and drop an image into here.
I wonder if it might actually be easier to use CKEditor's own file upload if you want to embed the images into the text of CKEditor.
The other option is to use the render option in the uploadMany field type to display not only the image as you currently are, but also the URL to get the image (you already have that - its just in an img tag, so you could display that as well as the image, allowing it to be copy / pasted into CKEditor.
Do you have the file name in the database? If so, you could use editor.file( 'tableName', id ).fileName or similar (file()). It really depends on what you are saving in the database about the files. Can you show me your server-side code for the upload?
Answers
I am using the upload-many script to upload the files in the editor.
Is there a fileUploaded event I can get the info from?
Cheers
Steve Warby
If the server sends back information about the file, including the file name, then yes, you could get it that way -
...file( 'files', field ).fileName
for example. This depends on what is being stored in the database though.In terms of events, actually no. It triggers events once the file has been uploaded, but not prior to the upload.
What information are you storing in the database?
Allan
I am using an editor and have added a CKEditor to edit one of the fields.
Within the CKEditor I am adding the images that I upload. So I cam have a field with all the information in.
So at the moment once an image has been uploaded I right click the thumbnail get the new file image url and manually add that in the ckeditor.
My aim is on new file upload.
This is how I am getting the details column here www.surplusanywhere.com/surplusAnywhere6 which I then offer a button so the client can email that particular deal to themselves ( eventually )
PS I just noticed I can drag and drop an image into here.
Cheers
Steve Warby
I wonder if it might actually be easier to use CKEditor's own file upload if you want to embed the images into the text of CKEditor.
The other option is to use the
render
option in theuploadMany
field type to display not only the image as you currently are, but also the URL to get the image (you already have that - its just in animg
tag, so you could display that as well as the image, allowing it to be copy / pasted into CKEditor.Allan
Thanks Allan,
from here https://editor.datatables.net/reference/field/uploadMany I have added the 'show new file added'.
I am presuming this is the event I need to get the new filename and add the image to the CKEditor.
I don't get an alert ?
Cancel this sorry i'd put the show new file added within the Edit Entry.....
I was drinking last night
Hi Guys,
I'm struggling on the logic ( as usual) of how to obtain just the added filename.
Eg say I have 3 images files already.
val gives me
217,218,219
I add another images
val gives me
217,218,219,220
I need to get just 220.
But each time I add val gets overwritten.
Cheers
Steve Warby
Do you have the file name in the database? If so, you could use
editor.file( 'tableName', id ).fileName
or similar (file()
). It really depends on what you are saving in the database about the files. Can you show me your server-side code for the upload?Allan