responsive filemanager doesn't show pdf - responsive-filemanager

I'm using responsivefilemanger for a filemanger. The thing is now, if i upload a pdf, it upload it onto the server, but it doesn't shows it on the filemanager itself. It seams there is a problem to generate thumbnails from pdf or other files (word, excel). With Images, all works very well.
Any idea how to solve this problem?
Thanks in advance.

A bit late, but faced the same problem just now: If using as standalone dialog, be sure to set the url passing the right type parameter dialog.php?type=2.
From the official docs (http://www.responsivefilemanager.com/):
Select Image: (type=1 and set id of input text in field_id variable):
path to filemanager../filemanager/dialog.php?type=1&field_id=fieldID
Select Video: (type=3 and set id of input text in field_id variable):
path to filemanager../filemanager/dialog.php?type=3&field_id=fieldID
Select File: (type=2 and set id of input text in field_id variable):
path to filemanager../filemanager/dialog.php?type=2&field_id=fieldID

Related

Lotus Notes : How to limit the extension file type in the dialog box of the rich text lite field using thumbnails only?

Here is my problem: i have a rich text lite field, used to store a contact photo. Parameter of this field is:
- only allow for thumbnail with an image attachment name (mandatory) = ContactPhoto
Parameter of the Rich Text Lite
When the user clicks on it, a standard import dialog box (managed automatically by Notes) is open and all images type can be selected as shown here :
ScreenShot of the import dialog box
With the following code, I'm able to check the size of the photo:
Set uidoc=ws.CurrentDocument
Call uidoc.Refresh(True,True)
Set doc=uidoc.Document
oneKB = 1024
PhotoTrouve = False
Forall i In doc.Items
If i.type = Attachment Then
Set emb = doc.GetAttachment(i.values(0))
If emb.source="ContactPhoto" Then
PhotoTrouve = True
If emb.filesize > (50 * oneKB) Then
strError="The size of the photo should be less than 50 Kb."
End If
End If
End If
End Forall
If PhotoTrouve= False Then
strError="Photo is mandatory."
End If
But this is not enough. I also need to check if this is well a .jpg file. The problem is that, as this is a thumbnail, its name is ContactPhoto, without any extension and i don't know how to get the original extension of the file selected by the user (seems not to be possible).
So my question is : is it possible to force the standard dialog box of the "thumbnail rich text lite" field in order that it proposes only .jpg extension file type to the user ? How to ?
Or if not, do you know a solution to check that the original file is well a .jpg file ?
Note : even if I name the attachment CPhoto.jpg (instead of ContactPhoto) by example, the user can select all type of images, not only a jpg. The photo is saved in $FILE of the document under the name of CPhoto.jpg but I don't think that the file is finally a real .jpg format. And I absolutely need a jpg image as my final objective is then to export that image in an xml file, with the good format of jpg.
Thanks a lot for your replies and help.
Karen
You will have to translate it from C#, but code to check the file contents to see if it is a jpg can be found in this answer to a previous question on this site.

How to change the imageSource of image in?

I have an image in LiveCode that I would like to change to another image when a specific button is pressed. So far, I have tried this -
set the imageSource of image "The_Hangman" to "/HangMan/1.png"
However, I am getting an error code of:
execution error at line n/a (Object: can't set this property)
How do I fix this?
ImageSource refers to the image that is embedded in a text field, which is not what you want.
If you're using imported images, it's not intuitive at all, but the property you want to change is the text property:
set the text of image "abc" to the text of image "xyz"
Setting the text property changes the imageData and alphaData of the designated image at the same time.
If you're using referenced images (images outside your stack), set the fileName property of the image you want to change to the file path of the new image.
Here's how to do it using external image files:
Let's say you have your images stored in a folder called "images" that is in the same location on your disk as your stack file.
put "hang1.png,hang2.png,hang3.png" into tImgList
put 1 into tCurrImg
set the fileName of image "The_Hangman" to \
(specialFolderPath("resources") & item tCurrImg of tImgList)
Now by simply changing the value of tCurrImg you can display whichever external image file you want.

Converting a data URI back to SVG

Might be a silly question but is it possible to convert a data URI back to SVG? I've Googled & searched SO and found nothing on the subject, loads of stuff on the other way round of course.
Thanks!
Edit: sorry should've been more specific - a data:image like this:
data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MCA4MCI+PHBhdGggZmlsbD0iIzFBMzc2MSIgZD0iTTE3Ljc4IDI1LjY1Yy44OS0uODkgMi4zNS0uODkgMy4yNSAwTDQwIDQ0LjU5bDE4Ljk3LTE4Ljk1Yy44OS0uODkgMi4zNS0uODkgMy4yNCAwbDIuNDMgMi40M2MuODkuODkuODkgMi4zNSAwIDMuMjVMNDEuNjIgNTQuMzVjLS45Ljg5LTIuMzUuODktMy4yNSAwTDE1LjM1IDMxLjMzYy0uODktLjg5LS44OS0yLjM1IDAtMy4yNWwyLjQzLTIuNDN6Ii8+PC9zdmc+
View the data URI in a web browser
Use inspect element
Open the data URI in new browser window/tab
Save the image as an .svg file
I am going to assume you mean a Base64 encoded data URI.
The answer is yes. The URI will look something like:
data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0c...
The Base64 part is the part that starts with PH. Copy that part into an online converter such as this one.
Using javascript, you can open developer tool and run this code in the
console:
var dataURI = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MCA4MCI+PHBhdGggZmlsbD0iIzFBMzc2MSIgZD0iTTE3Ljc4IDI1LjY1Yy44OS0uODkgMi4zNS0uODkgMy4yNSAwTDQwIDQ0LjU5bDE4Ljk3LTE4Ljk1Yy44OS0uODkgMi4zNS0uODkgMy4yNCAwbDIuNDMgMi40M2MuODkuODkuODkgMi4zNSAwIDMuMjVMNDEuNjIgNTQuMzVjLS45Ljg5LTIuMzUuODktMy4yNSAwTDE1LjM1IDMxLjMzYy0uODktLjg5LS44OS0yLjM1IDAtMy4yNWwyLjQzLTIuNDN6Ii8+PC9zdmc+';
var svg = atob(dataURI.replace(/data:image\/svg\+xml;base64,/, ''));
console.log(svg);
The atob() method decodes a base-64 encoded string.
Check out this website SVG VIEWER. You can put your .svg file or SVG Text-Based to this website. After that, you can download as .svg, .jsx, and .png extension.

Display image with Projection in Orchard 1.7

how to display image with with Projection in Orchard 1.7.
i have try but not able to get image its sow me ID with select html layout and custom display html.
can some on help me to get image with orchard projection/query
==Updated Post
I have one Query to select all company name (input text) , detail (input text) and company image, i want to show a list of all company name with image thumb on front site with projection and query ...list is coming but how to get image that is the problem.
thanks
If you're using ImagePart you should be able to access to MediaPart. MediaPart has FolderPath and FileName property. Just do something like this: Image.As.FolderPath to access to it in your shape.
If you are not using ImagePart, be more specific (e.g. showing some code)

I Need Help Modifying CKEditor's Default Image Property Paths

I am using CKEditor with Drupal 6.19. I have tried my installation with both CKFinder and IMCE. When an image is inserted from the image browser into the Image Properties window, CKEditor gets a url similar to:
/sites/example.com/files/images/my_image.jpg
I want CKEditor to simply have:
/files/images/my_image.jpg
file structure of my site is this:
/sites/all/modules/ckeditor/ckeditor
/sites/all/modules/ckeditor/ckfinder
/sites/all/modules/imce
/sites/example.com/files/images/my_mages.jpg
Is this url passed from the file browser, or a default in CKEditor?
If it is CKEditor, where do I find the code to change this, or is it even possible?
The URL suggested /sites/example.com/files/images/my_image.jpg is the correct path. Thats because all files are uploaded to the /sites/example.com/files/ folder. The behavior is correct and should not be modified. (Unless I've not understood your problem correctly or there is a very good reason why you want to store your images under DRUPAL_ROOT/files/images)

Resources