[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-javascript-dev
Subject:    Re: [Dev] [ES] input type 'file' not retrieved
From:       Shiva Balachandran <shiva () wso2 ! com>
Date:       2014-12-30 13:58:13
Message-ID: CAEKTFcc0nS6ZGWMj7P=TH_12=-ioiwtut1VnZVb6ub_+cR2C+A () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Sameera and Denuwanthi,

I have a custom asset, i have overridden the files and added the input file
tags and the file upload works. But when i want to edit the asset, i need
to set the name of the previously uploaded file and preserve the local
location of where the file is so when the user clicks on edit he should be
able to view the previously added file name listed and when he clicks on
the choose file button it should open the location of the file in local
directory in the finder. I am able to retrieve the values but when i set it
to the input file tag field it does not work. I noticed that this happens
with the thumbnails and banners too.

What will happen when if a new thumbnail or banner is uploaded in the edit
mode? and is there a way to achieve the above mentioned requirement?


Thank you.

Regards,
Shiva Balachandran

On Thu, Dec 18, 2014 at 11:57 AM, Sameera Medagammaddegedara <
sameeram@wso2.com> wrote:

> Hi Denuwanthi,
>
> The ES will first scan for any file fields and put them in the ES
> storage.After which the options object is augmented with the name of the
> field and a storage UUID before being passed to the asset create method.if
> the file field is not found in the RXT definition it is ignored.In this
> case the wsdl_zip field is not defined in the RXT definition and is a file
> field.
>
> In order to by pass this behaviour you will need to implement a custom API
> endpoint and invoke your asset create logic.
>
> Thank You,
> Sameera
>
>
> On Tue, Dec 16, 2014 at 11:55 PM, Denuwanthi De Silva <denuwanthi@wso2.com
> > wrote:
>>
>> Hi,
>>
>> In the custom asset extension I'm working on, I have a requirement to
>> support file upload.
>>
>> Thus, in my overridden partial (create_form.hbs) I use
>> <input type='*file*' name='*wsdl_zip*' id='*wsdl_zip*' />
>> to get the html view of the file uploader.
>>
>> Then, in my extension's asset.js inside 'create' method, I try to access
>> the value taken by that html element by using,
>>
>> *options.wsdl_zip*
>>
>> But, when I actually browse file and log the above value, it prints
>> 'null' and the 'options' json object does not even contain 'wsdl_zip'
>> attribute.
>>
>> If I use a text field instead of using type 'file',
>>
>> <input type='text' name=wsdl_zip' id='wsdl_zip' />
>>
>>
>> options.wsdl_zip returns the value I entered in the text field.
>>
>> So, what could be the reason for not retrieving 'file' type inputs ?
>> Any other configurations need to be done?
>>
>> Thanks,
>> --
>> Denuwanthi De Silva
>> Software Engineer;
>> WSO2 Inc.; http://wso2.com,
>> Email: denuwanthi@wso2.com
>>
>>
>>
>
> --
> Sameera Medagammaddegedara
> Software Engineer
>
> Contact:
> Email: sameeram@wso2.com
> Mobile: + 94 077 255 3005
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Shiva Balachandran
Software Engineer
WSO2 Inc.

Mobile - +94 774445788

[Attachment #5 (text/html)]

<div dir="ltr">Hi Sameera and Denuwanthi,<div><br></div><div>I have a custom asset, i \
have overridden the files and added the input file tags and the file upload works. \
But when i want to edit the asset, i need to set the name of the previously uploaded \
file and preserve the local location of where the file is so when the user clicks on \
edit he should be able to view the previously added file name listed and when he \
clicks on the choose file button it should open the location of the file in local \
directory in the finder. I am able to retrieve the values but when i set it to the \
input file tag field it does not work. I noticed that this happens with the \
thumbnails and banners too.<br><br></div><div>What will happen when if a new \
thumbnail or banner is uploaded in the edit mode? and is there a way to achieve the \
above mentioned requirement?  <br><div><br></div></div><div><br></div><div>Thank \
you.<br><br>Regards,<br></div><div>Shiva Balachandran</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 18, 2014 at 11:57 AM, \
Sameera Medagammaddegedara <span dir="ltr">&lt;<a href="mailto:sameeram@wso2.com" \
target="_blank">sameeram@wso2.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Denuwanthi,<br><br></div>The \
ES will first scan for any file fields and put them in the ES storage.After which the \
options object is augmented with the name of the field and a storage UUID before \
being passed to the asset create method.if the file field is not found in the RXT \
definition it is ignored.In this case the wsdl_zip field is not defined in the RXT \
definition and is a file field.<br><br></div><div>In order to by pass this behaviour \
you will need to implement a custom API endpoint and invoke your asset create \
logic.<br></div><div><br></div>Thank \
You,<br></div>Sameera<br><div><div><div><br></div></div></div></div><div \
class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Tue, Dec 16, \
2014 at 11:55 PM, Denuwanthi De Silva <span dir="ltr">&lt;<a \
href="mailto:denuwanthi@wso2.com" target="_blank">denuwanthi@wso2.com</a>&gt;</span> \
wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div \
dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>In the custom asset \
extension I&#39;m working on, I have a requirement to support file \
upload.<br><br></div>Thus, in my overridden partial (create_form.hbs) I use \
<br>&lt;input type=&#39;<b>file</b>&#39; name=&#39;<b>wsdl_zip</b>&#39; \
id=&#39;<b>wsdl_zip</b>&#39; /&gt;<br></div>to get the html view of the file \
uploader.<br><br></div>Then, in my extension&#39;s asset.js inside &#39;create&#39; \
method, I try to access the value taken by that html element by \
using,<br><br><b>options.wsdl_zip</b><br><br></div>But, when I actually browse file \
and log the above value, it prints &#39;null&#39; and the &#39;options&#39; json \
object does not even contain &#39;wsdl_zip&#39; attribute.<br><br></div>If I use a \
text field instead of using type &#39;file&#39;,<br><br>&lt;input type=&#39;text&#39; \
name=wsdl_zip&#39; id=&#39;wsdl_zip&#39; /&gt;<br \
clear="all"><div><div><div><div><div><div><div><br></div><div><br>options.wsdl_zip \
returns the value I entered in the text field.<br><br></div><div>So, what could be \
the reason for not retrieving &#39;file&#39; type inputs ?<br></div><div>Any other \
configurations need to be done?<br><br></div><div>Thanks, <br></div><span><font \
color="#888888"><div>-- <br><div><div dir="ltr"><div><div><div>Denuwanthi De \
Silva<br>Software Engineer; <br>WSO2 Inc.; <a href="http://wso2.com" \
target="_blank">http://wso2.com</a>,<br></div>Email: <a \
href="mailto:denuwanthi@wso2.com" \
target="_blank">denuwanthi@wso2.com</a><br></div><br></div><br></div></div> \
</div></font></span></div></div></div></div></div></div></div> </blockquote></div><br \
clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- \
<br><div><div dir="ltr"><font style="font-family:arial,helvetica,sans-serif"><span \
style="color:rgb(102,102,102)">Sameera Medagammaddegedara</span><br \
style="color:rgb(102,102,102)">

<span style="color:rgb(102,102,102)">Software Engineer</span><br \
style="color:rgb(102,102,102)"><br style="color:rgb(102,102,102)"><span \
style="color:rgb(102,102,102)">Contact:</span><br>Email: <a \
href="mailto:sameeram@wso2.com" target="_blank">sameeram@wso2.com</a><br \
style="color:rgb(102,102,102)"><span style="color:rgb(102,102,102)">Mobile: <a \
value="+94773698421">+ 94 077 255 3005<br></a></span></font></div></div> \
</font></span></div> <br>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@wso2.org">Dev@wso2.org</a><br>
<a href="http://wso2.org/cgi-bin/mailman/listinfo/dev" \
target="_blank">http://wso2.org/cgi-bin/mailman/listinfo/dev</a><br> \
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature"><div dir="ltr">Shiva Balachandran<div>Software \
Engineer</div><div>WSO2 Inc.</div><div><br>Mobile - +94 774445788</div></div></div> \
</div>



_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic