Attachments preview

Discussions about Forms Designer for SharePoint 2010.
Locked
User avatar
luca.faro
Posts: 5
Joined: Tue Jan 16, 2018

16 Jan 2018

Hi.

Is there a way to show a preview of an attachment in the form?
I need to attach a picture taken from a smartphone to elements of a list ; then I'd like to make a preview of that when you're in display mode...

Is it possible?

Thanks for your help.

Luca

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

16 Jan 2018

Hello, Luca!
Please, check out this topic, I believe it can help you!
Cheers

User avatar
luca.faro
Posts: 5
Joined: Tue Jan 16, 2018

17 Jan 2018

WOW! Many thanks.
I only searched in this Area (sp 2010) and not in the other...
Just one thing...
I exactly copied everything but I dont' understand why I cannot get the hyperlink when I click the picture..(I'm not an expert ... :-))

Thanks again
Luca

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

17 Jan 2018

Dear Luca,
The example in the other topic doesn't have hyperlinks included, but you can modify code like this and it should work:

Code: Select all

var preview = "";

$("a[href*='/Attachments/'").each(function(){
	preview += "<a href='" + $(this).attr("href") + "' target='_blank'><img class='thumbnail' src='" + $(this).attr("href") + "'></a>";
});

if (preview == "") { 
	preview = "There are no items to display."
}


$(".imgPreview").html(preview);
Cheers

User avatar
luca.faro
Posts: 5
Joined: Tue Jan 16, 2018

18 Jan 2018

MANY MANY MANY thanks!!!
Luca

benniefuT
Posts: 4
Joined: Sat Apr 20, 2019
Location: Denmark
Contact:

25 Apr 2019

When I preview an email body in "Email and attachments" view I do NOT see the attachment names.

When I preview the same email in "Email" view, I DO see the attachment names.

This is annoying, I want to see the email body preview to show the same thing in both views.

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

25 Apr 2019

Dear benniefut,
Are you sure you've added Attachments field to both Content Types? Can you show us screenshots of both forms in designer and in the browser?
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests