Welcome Guest Search | Active Topics | Sign In | Register

EO.Web AJAX Uploader Options
Kevin
Posted: Thursday, September 11, 2014 3:33:06 PM
Rank: Newbie
Groups: Member

Joined: 9/11/2014
Posts: 3
Hi,

I am uploading a file using the AJAX Uploader control. The web application requirement is to virus scan the uploaded file immediately after upload completes. The I am using Metascan Lite to check the file.

My understanding is I don't have access to the TempFileName property on the client-side.

How do I virus check the file immediately after upload? Is Callback control an option?
eo_support
Posted: Thursday, September 11, 2014 4:25:32 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

You can only check the file on the server. You can handle the AJAXUploader's FileUploaded event and then run your check there.

Thanks
Kevin
Posted: Friday, September 12, 2014 9:10:37 AM
Rank: Newbie
Groups: Member

Joined: 9/11/2014
Posts: 3
Hi,

Thanks in advance for your help.

Is the FileUploaded event fired after the AJAXUpload is done uploading the file?

OR

Is the FileUploaded event fired after the ASP.NET form is submitted by submit button?


This post indicates the TempFileName property is available using the CallbackPanel:

http://www.essentialobjects.com/Forum/default.aspx?g=posts&t=1044

quote from above post:
"As mentioned in the topic, you may also want to take a look of CallbackPanel. With CallbackPanel you can basically calls any server side code from client side. This helps when the interface that you are seeking is only available on the server side, like the TempFileName you are looking for."

My understanding is TempFileName is available via PostedFiles.

Is the server-side PostedFiles member/property populated during a CallbackPanel exectue call?

Kevin
eo_support
Posted: Friday, September 12, 2014 9:45:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

All ASP.NET WebForm server events are triggered when form submits. FileUploaded event is no exception. The only difference is how the form submit is triggered. Below are a few common scenarios:

1. User click a submit button to submit the form;
2. Set AJAXUploader's AutoPostBack to true, then the uploader will automatically posts back the form when it finishes upload;
3. Trigger an AJAX callback through CallbackPanel. This way the CallbackPanel will submit the form, but after submitting the form, instead of refreshing the whole page, it only refresh the area within the CallbackPanel boundary;

No matter how the form submit is triggered, server side events/properties should be populated the same.

Hope this help.

Thanks!
Kevin
Posted: Friday, September 12, 2014 12:01:10 PM
Rank: Newbie
Groups: Member

Joined: 9/11/2014
Posts: 3
Hi,

Thanks for the feedback.

I have simple prototype page which demonstrates #3 (Trigger an AJAX callback through CallbackPanel). The FileUploaded event is not getting fired on ajax callback. The PostedFiles collection is also empty on ajax callback. #3 would help solve my problem if it worked.

Can I email my code for review?

Kevin
eo_support
Posted: Friday, September 12, 2014 12:09:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

Certainly. Please see here for more information on how to submit a test project:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
eo_support
Posted: Friday, September 12, 2014 3:26:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

We have received your test project. Please do not use eo_Callback. In order for the form to be posted the same way as clicking a button, you can use a ScriptEvent object and then set it as a trigger for the CallbackPanel. It will be something like this:

Code: HTML/ASPX
<eo:ScriptEvent runat="server" ID="se1"></eo:ScriptEvent>

<eo:CallbackPanel runat="server" ID="cp1" 
    Triggers="{ControlID:se1;Parameter:}">
    .....
</eo:CallbackPanel>


Then you can use the following code to trigger the callback:

Code: JavaScript
//Trigger ScriptEvent se1's Command event. However
//it will also trigger other events that associated to the
//form submit, such as the AJAXUploader's FileUploaded
//event
eo_TriggerServerEvent('se1');


Please let us know if this works for you.

Thanks!


spede
Posted: Friday, September 19, 2014 8:05:15 AM
Rank: Newbie
Groups: Member

Joined: 9/19/2014
Posts: 1
Hello,

Apologies for "hijacking" the thread, but I have a question about AJAX Uploader and I don't think it's worthy of a new thread.

I've been using AJAX Uploader for a while now and stumbled upon a problem when trying to change button texts in code while using a custom layout for the control.

If I use the standard layout everything works fine, but with custom layout I seem to be unable to change the button texts? (upload & cancel button)

Also, is there a way to hide the posted file list when using the standard layout?
That would also solve my problem and I could use the standard layout instead.

Thank you
eo_support
Posted: Friday, September 19, 2014 11:48:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi Spede,

Please always use a new thread for new questions. Every new question deserves full attention and thus is worthy for a new thread. :)

I believe in our old versions as soon as you use CustomLayout, the control believes that you are fully in charge and ignores everything else such as Update button text. The new version however recognizes that it's much easier for the end user if we still honor these properties even if you use CustomLayout. So you might want to give the new version a try to see if it solves the problem for you.

If you already own a license for an older version, depending on the version you purchased, you maybe able to receive the new version completely free, or with an upgrade discount, or need a completely new license. If you do not wish to use the new version because of this or for any other reasons, then you can always change the text in your layout template. Or if you want to dynamically change the text, you can write code to call FindControl on the AJAXUploader to find your button and change the text dynamically.

Thanks!


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.