Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
JesusInz  
#1 Posted : Tuesday, April 17, 2012 9:15:56 AM(UTC)
JesusInz

Rank: Newbie

Groups: Member
Joined: 4/4/2012(UTC)
Posts: 8

Hi,

In my website, I use tabs to display different kind of information for users. One of the tabs is "Photos", and I'm trying to incorporate IUF in it.

The first time the user clicks the "Photos" tab, the uploader gets render correctly, with all the settings specified.

The problem arises when I select a different tab, and then go back to the "Photos" tab: the uploader gets rendered again but without settings like language, fileMask, ShowViewComboBox, etc. The only settings that are kept are the dimensions and the max number of files.

Is this a bug or is there a workaround? Please let me know.

Note: the content of each tab is loaded entirely when the page loads. There's no postback when the user selects a different tab.

Thanks in advance

Edited by user Tuesday, April 17, 2012 9:54:38 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Tuesday, April 17, 2012 9:00:26 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Jesus,

Could you please provide me with a direct link to your page with Image Uploader Flash (login/password if any)? If you do not want to post this information here, you will be able to submit new support ticket.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
JesusInz  
#3 Posted : Wednesday, April 18, 2012 2:18:49 PM(UTC)
JesusInz

Rank: Newbie

Groups: Member
Joined: 4/4/2012(UTC)
Posts: 8

Hi Dmitry,

I'v created a test page where you can reproduce this bug: click here

Steps to reproduce:
1. Select the "Photos Tab" and the uploader will render correctly with all its settings.
2. Click on any other tab
3. Go back to the uploader tab. It will render again ignoring all settings, including fileMask.

Browsers I tested where this problem is reproduced:
Google Chrome 18
Firefox 10
Safari 5

Strangely, Internet Explorer seems to be the only browser where the uploader works correctly. Tested on IE7, IE8 and IE9.

Hoper there's a workaround.

Edit: To change the content of each tab, I use:
Code:
document.getElementById('<%= tabX.ClientID %>').style.display = 'none';

Edited by user Wednesday, April 18, 2012 2:50:04 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#4 Posted : Wednesday, April 18, 2012 8:56:40 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hi Jesus,

Thanks for the link and details. It was very helpful to find out the problem:) As I assumed it occurs because of using display = "none". To make Flash Uploader control hiding properly you will need to use visibility = 'hidden' and set height of the container to zero. Please see details and sample application how to hide/show the uploader here.
Why it works fine in IE? It is just cross-browser problem.

If you have any additional questions or problems please let me know.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
JesusInz  
#5 Posted : Friday, April 20, 2012 5:06:53 PM(UTC)
JesusInz

Rank: Newbie

Groups: Member
Joined: 4/4/2012(UTC)
Posts: 8

Ok, I guess I'll have to tweak some of my site's design, no biggie.

I have a different question, more on the coding side. I'm placing the uploader inside a usercontrol, which is loaded when the user wants to modify its information.

UploaderUserControl.ascx
Code:

<aur:ImageUploaderFlash ID="Uploader1" runat="server"
    EnableDescriptionEditor="false" Language="spanish" LicenseKey="<%$ AppSettings:ImageUploaderLicenseKey %>"
    OnFileUploaded="FileUploaded"> 
    <Converters>
        <aur:Converter Mode="*.*=Thumbnail" ThumbnailWidth="320" ThumbnailHeight="320" ThumbnailFitMode="Fit" ThumbnailJpegQuality="90" />
    </Converters>                            
    <UploadPane ViewMode="Thumbnails" ThumbnailPreviewSize="75" AddFilesButtonText="Agregar" />
    <Restrictions MaxFileCount="10" MaxFileSize="4194304" FileMask="[['Images (*.jpg; *.jpeg; *.png; *.gif)', '*.jpg;*.jpeg;*.png;*.gif']]" />
</aur:ImageUploaderFlash>  


UploaderUserControl.ascx.cs
Code:

public partial class usuariosp_casas : xbifuncytion
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //--Some code
    }
    protected void FileUploaded(object sender, FileUploadedEventArgs e)
    {
        Aurigma.ImageUploaderFlash.UploadedFile uploadedFile = e.UploadedFile;
        ConvertedFile thumbnailFile = uploadedFile.ConvertedFiles[0];
        string thumbnailName;
        string tempImagePath = Server.MapPath("~/ImageResizeCache/");
        string nombreTemporal = Session["uniquePicId"].ToString() + "-idU_" + Session["idUsuariop"].ToString() + "_foto-";

        int counter = e.UploadedFile.Package.PackageIndex + 1;

        if (thumbnailFile != null && thumbnailFile.Size != 0)
        {
            thumbnailName = Utils.GetSafeFotoName(tempImagePath, nombreTemporal + counter + ".jpg", counter);
            thumbnailFile.SaveAs(Path.Combine(tempImagePath, thumbnailName));
        }
    }
}



The problem is that it is not uploading any images, as "OnFileUploaded" is not being executed. I placed this function on the usercontrol's codebehind. Am I missing something?

Thanks again.


Edit:
I discovered that I have to load the usercontrol again for each file the user uploads. This means loading ALL the content of the parent page and the usercontrol as well...for each file!

On page load I'm using:
if (!Page.IsPostBack && !String.Equals(Request.RequestType, "POST"))
{
//loads one time normal content
}
PlaceHolder1.Controls.Add(LoadControl("UploaderUserControl.ascx"));

But it seems I'm just patching holes. What's the best solution in this scenario?

Edited by user Saturday, April 21, 2012 8:41:20 AM(UTC)  | Reason: Not specified

JesusInz  
#6 Posted : Saturday, April 21, 2012 10:37:16 AM(UTC)
JesusInz

Rank: Newbie

Groups: Member
Joined: 4/4/2012(UTC)
Posts: 8

Ok I'm replying to myself since I found the solution to the issue ;)

I manage to solve the usercontrol issue by creating a separate .ashx handler to save the files. By setting the ActionUrl to this handler, the usercontrol and the main page won't have to postback.

Hope this helps anyone struggling with the same problem.

Edited by user Saturday, April 21, 2012 3:13:42 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.