Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > FileUpload Control on Mobile Form

Reply
Thread Tools

FileUpload Control on Mobile Form

 
 
Woodgnome
Guest
Posts: n/a
 
      08-24-2007
Hi,

I am trying to provide the user with a file upload facility on mobile
devices that will support it. So I have tried using the FileUpload control in
a device specific section - as follows, but when the form posts back, the
HasFile proerty is always set to false and the file is nowhere to be seen.
It would appear that it may be something to do with the fact that the form is
rendering without enctype="multipart/form-data" on the form tag. Anyone any
ideas how I might get this to work ?

<mobile:Form ID="NewForm" runat="server" Title="New Form">

<mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
<Choice>
<FooterTemplate>
<tr>
<td>
<asp:FileUpload ID="fileUpload1"
runat="server"></asp:FileUpload>
</br>
<asp:FileUpload ID="fileUpload2"
runat="server"></asp:FileUpload>
</br>
<asp:FileUpload ID="fileUpload3"
runat="server"></asp:FileUpload>
</td>
</tr>
</FooterTemplate>
</Choice>
</mobileeviceSpecific>

.......
 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      08-27-2007
Hi Woodgnome,

Regarding on the ASP.NET mobile page fileuploading issue, I've performed
some local tests and did found the same behavior as you mentioned. It seems
the Mobile Form doesn't allow us to insert our custom attributes into it
like a standard htmlForm control. I've also tried manually add the
"enctype="multipart/form-data" " attribute into the mobile form and it was
also ignored and runtime. BTW, for mobile devices, I notice that few WAP
or xhtml mp devices support file upload element,

http://www.developershome.com/wap/wa...asp?page=intro

so are your web application's target devices HTML enabled? If so, maybe
you can consider use a standard ASP.NET page(not mobile page) to serve the
fileupload functionality(since only a simple screen with some text and file
upload html element are necessary), how do you think?

Anyway, I'll also help you consult some other mobile engineers to see
whether there is anything else we can do here, I'll inform you as soon as I
get any update.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------

>
>Hi,
>
>I am trying to provide the user with a file upload facility on mobile
>devices that will support it. So I have tried using the FileUpload control

in
>a device specific section - as follows, but when the form posts back, the
>HasFile proerty is always set to false and the file is nowhere to be seen.


>It would appear that it may be something to do with the fact that the form

is
>rendering without enctype="multipart/form-data" on the form tag. Anyone

any
>ideas how I might get this to work ?
>
><mobile:Form ID="NewForm" runat="server" Title="New Form">
>
><mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
> <Choice>
> <FooterTemplate>
> <tr>
> <td>
> <asp:FileUpload ID="fileUpload1"
>runat="server"></asp:FileUpload>
> </br>
> <asp:FileUpload ID="fileUpload2"
>runat="server"></asp:FileUpload>
> </br>
> <asp:FileUpload ID="fileUpload3"
>runat="server"></asp:FileUpload>
> </td>
> </tr>
> </FooterTemplate>
> </Choice>
></mobileeviceSpecific>
>
>......
>


 
Reply With Quote
 
 
 
 
Woodgnome
Guest
Posts: n/a
 
      08-28-2007
Steven,

Thanks for the reply. The initial target devices are HTML enabled - but the
intention was to make the pages available to more devices at a later date.
I will investigate using a standard asp.net page for now.

Thanks.
Woodgnome.



"Steven Cheng[MSFT]" wrote:

> Hi Woodgnome,
>
> Regarding on the ASP.NET mobile page fileuploading issue, I've performed
> some local tests and did found the same behavior as you mentioned. It seems
> the Mobile Form doesn't allow us to insert our custom attributes into it
> like a standard htmlForm control. I've also tried manually add the
> "enctype="multipart/form-data" " attribute into the mobile form and it was
> also ignored and runtime. BTW, for mobile devices, I notice that few WAP
> or xhtml mp devices support file upload element,
>
> http://www.developershome.com/wap/wa...asp?page=intro
>
> so are your web application's target devices HTML enabled? If so, maybe
> you can consider use a standard ASP.NET page(not mobile page) to serve the
> fileupload functionality(since only a simple screen with some text and file
> upload html element are necessary), how do you think?
>
> Anyway, I'll also help you consult some other mobile engineers to see
> whether there is anything else we can do here, I'll inform you as soon as I
> get any update.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
>
> ==================================================
>
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
>
>
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
>
> ==================================================
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> --------------------
>
> >
> >Hi,
> >
> >I am trying to provide the user with a file upload facility on mobile
> >devices that will support it. So I have tried using the FileUpload control

> in
> >a device specific section - as follows, but when the form posts back, the
> >HasFile proerty is always set to false and the file is nowhere to be seen.

>
> >It would appear that it may be something to do with the fact that the form

> is
> >rendering without enctype="multipart/form-data" on the form tag. Anyone

> any
> >ideas how I might get this to work ?
> >
> ><mobile:Form ID="NewForm" runat="server" Title="New Form">
> >
> ><mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
> > <Choice>
> > <FooterTemplate>
> > <tr>
> > <td>
> > <asp:FileUpload ID="fileUpload1"
> >runat="server"></asp:FileUpload>
> > </br>
> > <asp:FileUpload ID="fileUpload2"
> >runat="server"></asp:FileUpload>
> > </br>
> > <asp:FileUpload ID="fileUpload3"
> >runat="server"></asp:FileUpload>
> > </td>
> > </tr>
> > </FooterTemplate>
> > </Choice>
> ></mobileeviceSpecific>
> >
> >......
> >

>
>

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      08-29-2007
Hi Woodgnome,

Thanks for your reply.

Yes, a standard html based ASP.NET page will save much effort. Anyway, I'm
still doing some further research on this and will inform you if I get any
new information helpful.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.





--------------------
>Xref: TK2MSFTNGHUB02.phx.gbl

microsoft.public.dotnet.framework.aspnet.webcontro ls:2217
>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
>
>Steven,
>
>Thanks for the reply. The initial target devices are HTML enabled - but

the
>intention was to make the pages available to more devices at a later date.
>I will investigate using a standard asp.net page for now.
>
>Thanks.
>Woodgnome.
>
>
>
>"Steven Cheng[MSFT]" wrote:
>
>> Hi Woodgnome,
>>
>> Regarding on the ASP.NET mobile page fileuploading issue, I've performed
>> some local tests and did found the same behavior as you mentioned. It

seems
>> the Mobile Form doesn't allow us to insert our custom attributes into

it
>> like a standard htmlForm control. I've also tried manually add the
>> "enctype="multipart/form-data" " attribute into the mobile form and it

was
>> also ignored and runtime. BTW, for mobile devices, I notice that few

WAP
>> or xhtml mp devices support file upload element,
>>
>> http://www.developershome.com/wap/wa...asp?page=intro
>>
>> so are your web application's target devices HTML enabled? If so, maybe
>> you can consider use a standard ASP.NET page(not mobile page) to serve

the
>> fileupload functionality(since only a simple screen with some text and

file
>> upload html element are necessary), how do you think?
>>
>> Anyway, I'll also help you consult some other mobile engineers to see
>> whether there is anything else we can do here, I'll inform you as soon

as I
>> get any update.
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>>
>> ==================================================
>>
>> Get notification to my posts through email? Please refer to
>>

http://msdn.microsoft.com/subscripti...ult.aspx#notif
>> ications.
>>
>>
>>
>> Note: The MSDN Managed Newsgroup support offering is for non-urgent

issues
>> where an initial response from the community or a Microsoft Support
>> Engineer within 1 business day is acceptable. Please note that each

follow
>> up response may take approximately 2 business days as the support
>> professional working with you may need further investigation to reach

the
>> most efficient resolution. The offering is not appropriate for

situations
>> that require urgent, real-time or phone-based interactions or complex
>> project analysis and dump analysis issues. Issues of this nature are

best
>> handled working with a dedicated Microsoft Support Engineer by

contacting
>> Microsoft Customer Support Services (CSS) at
>> http://msdn.microsoft.com/subscripti...t/default.aspx.
>>
>> ==================================================
>>
>>
>> This posting is provided "AS IS" with no warranties, and confers no

rights.
>>
>>
>>
>> --------------------
>>
>> >
>> >Hi,
>> >
>> >I am trying to provide the user with a file upload facility on mobile
>> >devices that will support it. So I have tried using the FileUpload

control
>> in
>> >a device specific section - as follows, but when the form posts back,

the
>> >HasFile proerty is always set to false and the file is nowhere to be

seen.
>>
>> >It would appear that it may be something to do with the fact that the

form
>> is
>> >rendering without enctype="multipart/form-data" on the form tag. Anyone

>> any
>> >ideas how I might get this to work ?
>> >
>> ><mobile:Form ID="NewForm" runat="server" Title="New Form">
>> >
>> ><mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
>> > <Choice>
>> > <FooterTemplate>
>> > <tr>
>> > <td>
>> > <asp:FileUpload ID="fileUpload1"
>> >runat="server"></asp:FileUpload>
>> > </br>
>> > <asp:FileUpload ID="fileUpload2"
>> >runat="server"></asp:FileUpload>
>> > </br>
>> > <asp:FileUpload ID="fileUpload3"
>> >runat="server"></asp:FileUpload>
>> > </td>
>> > </tr>
>> > </FooterTemplate>
>> > </Choice>
>> ></mobileeviceSpecific>
>> >
>> >......
>> >

>>
>>

>


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      08-31-2007
Hi Woodgnome,

Are you still focus on this issue? I've just got some new info. I've
discussed with a DEV engineer who has ever worked on a similar issue, here
is a workaround for mobile page to use the fileupload control. See the
following comments

==================================
The reason upload control can't work on mobile page is the result rendered
by mobile page is lacking a form property: enctype="multipart/form-data".

To inject this property you can inherit Html/Chtml/XhtmlMobileTextWriter
class and override their WriteBeginTag method. The override method is
something link below:

public class ChtmlMobileMultipartTextWriter :
System.Web.UI.MobileControls.Adapters.ChtmlMobileT extWriter
{
public ChtmlMobileMultipartTextWriter(System.IO.TextWrite r writer,
MobileCapabilities device)
: base(writer, device)
{
}

public override void WriteBeginTag(string tag)
{
if (tag == null)
{
throw new ArgumentNullException("tag");
}

base.WriteBeginTag(tag);

if (tag.Equals("form"))
{
WriteAttribute("enctype", "multipart/form-data");
}
}
}

==============================

Hope this still helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>X-Tomcat-ID: 34003249
>References: <(E-Mail Removed)>

<B5gE#(E-Mail Removed)>
<(E-Mail Removed)>
>MIME-Version: 1.0
>Content-Type: text/plain
>Content-Transfer-Encoding: 7bit
>From: http://www.velocityreviews.com/forums/(E-Mail Removed) (Steven Cheng[MSFT])
>Organization: Microsoft
>Date: Wed, 29 Aug 2007 03:00:00 GMT
>Subject: RE: FileUpload Control on Mobile Form
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
>Message-ID: <(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
>Lines: 120
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl

microsoft.public.dotnet.framework.aspnet.webcontro ls:2222
>NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
>
>Hi Woodgnome,
>
>Thanks for your reply.
>
>Yes, a standard html based ASP.NET page will save much effort. Anyway, I'm
>still doing some further research on this and will inform you if I get any
>new information helpful.
>
>Sincerely,
>
>Steven Cheng
>
>Microsoft MSDN Online Support Lead
>
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>
>
>--------------------
>>Xref: TK2MSFTNGHUB02.phx.gbl

>microsoft.public.dotnet.framework.aspnet.webcontr ols:2217
>>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
>>
>>Steven,
>>
>>Thanks for the reply. The initial target devices are HTML enabled - but

>the
>>intention was to make the pages available to more devices at a later date.
>>I will investigate using a standard asp.net page for now.
>>
>>Thanks.
>>Woodgnome.
>>
>>
>>
>>"Steven Cheng[MSFT]" wrote:
>>
>>> Hi Woodgnome,
>>>
>>> Regarding on the ASP.NET mobile page fileuploading issue, I've

performed
>>> some local tests and did found the same behavior as you mentioned. It

>seems
>>> the Mobile Form doesn't allow us to insert our custom attributes into

>it
>>> like a standard htmlForm control. I've also tried manually add the
>>> "enctype="multipart/form-data" " attribute into the mobile form and it

>was
>>> also ignored and runtime. BTW, for mobile devices, I notice that few

>WAP
>>> or xhtml mp devices support file upload element,
>>>
>>> http://www.developershome.com/wap/wa...asp?page=intro
>>>
>>> so are your web application's target devices HTML enabled? If so,

maybe
>>> you can consider use a standard ASP.NET page(not mobile page) to serve

>the
>>> fileupload functionality(since only a simple screen with some text and

>file
>>> upload html element are necessary), how do you think?
>>>
>>> Anyway, I'll also help you consult some other mobile engineers to see
>>> whether there is anything else we can do here, I'll inform you as soon

>as I
>>> get any update.
>>>
>>> Sincerely,
>>>
>>> Steven Cheng
>>>
>>> Microsoft MSDN Online Support Lead
>>>
>>>
>>>
>>> ==================================================
>>>
>>> Get notification to my posts through email? Please refer to
>>>

>http://msdn.microsoft.com/subscripti...ault.aspx#noti

f
>>> ications.
>>>
>>>
>>>
>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent

>issues
>>> where an initial response from the community or a Microsoft Support
>>> Engineer within 1 business day is acceptable. Please note that each

>follow
>>> up response may take approximately 2 business days as the support
>>> professional working with you may need further investigation to reach

>the
>>> most efficient resolution. The offering is not appropriate for

>situations
>>> that require urgent, real-time or phone-based interactions or complex
>>> project analysis and dump analysis issues. Issues of this nature are

>best
>>> handled working with a dedicated Microsoft Support Engineer by

>contacting
>>> Microsoft Customer Support Services (CSS) at
>>> http://msdn.microsoft.com/subscripti...t/default.aspx.
>>>
>>> ==================================================
>>>
>>>
>>> This posting is provided "AS IS" with no warranties, and confers no

>rights.
>>>
>>>
>>>
>>> --------------------
>>>
>>> >
>>> >Hi,
>>> >
>>> >I am trying to provide the user with a file upload facility on mobile
>>> >devices that will support it. So I have tried using the FileUpload

>control
>>> in
>>> >a device specific section - as follows, but when the form posts back,

>the
>>> >HasFile proerty is always set to false and the file is nowhere to be

>seen.
>>>
>>> >It would appear that it may be something to do with the fact that the

>form
>>> is
>>> >rendering without enctype="multipart/form-data" on the form tag.

Anyone
>>> any
>>> >ideas how I might get this to work ?
>>> >
>>> ><mobile:Form ID="NewForm" runat="server" Title="New Form">
>>> >
>>> ><mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
>>> > <Choice>
>>> > <FooterTemplate>
>>> > <tr>
>>> > <td>
>>> > <asp:FileUpload ID="fileUpload1"
>>> >runat="server"></asp:FileUpload>
>>> > </br>
>>> > <asp:FileUpload ID="fileUpload2"
>>> >runat="server"></asp:FileUpload>
>>> > </br>
>>> > <asp:FileUpload ID="fileUpload3"
>>> >runat="server"></asp:FileUpload>
>>> > </td>
>>> > </tr>
>>> > </FooterTemplate>
>>> > </Choice>
>>> ></mobileeviceSpecific>
>>> >
>>> >......
>>> >
>>>
>>>

>>

>
>


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      09-04-2007
Hi Woodgnome,

Does the further info in my last reply helps? If there is anything else we
can help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>Date: Fri, 31 Aug 2007 04:02:44 GMT
>Subject: RE: FileUpload Control on Mobile Form
>>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls

ing-Host: tomcatimport2.phx.gbl 10.201.218.182
>
>Hi Woodgnome,
>
>Are you still focus on this issue? I've just got some new info. I've
>discussed with a DEV engineer who has ever worked on a similar issue, here
>is a workaround for mobile page to use the fileupload control. See the
>following comments
>
>==================================
>The reason upload control can't work on mobile page is the result rendered
>by mobile page is lacking a form property: enctype="multipart/form-data".
>
>To inject this property you can inherit Html/Chtml/XhtmlMobileTextWriter
>class and override their WriteBeginTag method. The override method is
>something link below:
>
>public class ChtmlMobileMultipartTextWriter :
>System.Web.UI.MobileControls.Adapters.ChtmlMobile TextWriter
> {
> public ChtmlMobileMultipartTextWriter(System.IO.TextWrite r writer,
>MobileCapabilities device)
> : base(writer, device)
> {
> }
>
> public override void WriteBeginTag(string tag)
> {
> if (tag == null)
> {
> throw new ArgumentNullException("tag");
> }
>
> base.WriteBeginTag(tag);
>
> if (tag.Equals("form"))
> {
> WriteAttribute("enctype", "multipart/form-data");
> }
> }
>}
>
>==============================
>
>Hope this still helps.
>
>Sincerely,
>
>Steven Cheng
>
>Microsoft MSDN Online Support Lead
>
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>--------------------
>>X-Tomcat-ID: 34003249
>>References: <(E-Mail Removed)>

><B5gE#(E-Mail Removed)>
><(E-Mail Removed)>
>>MIME-Version: 1.0
>>Content-Type: text/plain
>>Content-Transfer-Encoding: 7bit
>>From: (E-Mail Removed) (Steven Cheng[MSFT])
>>Organization: Microsoft
>>Date: Wed, 29 Aug 2007 03:00:00 GMT
>>Subject: RE: FileUpload Control on Mobile Form
>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
>>Message-ID: <(E-Mail Removed)>
>>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
>>Lines: 120
>>Path: TK2MSFTNGHUB02.phx.gbl
>>Xref: TK2MSFTNGHUB02.phx.gbl

>microsoft.public.dotnet.framework.aspnet.webcontr ols:2222
>>NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
>>
>>Hi Woodgnome,
>>
>>Thanks for your reply.
>>
>>Yes, a standard html based ASP.NET page will save much effort. Anyway,

I'm
>>still doing some further research on this and will inform you if I get

any
>>new information helpful.
>>
>>Sincerely,
>>
>>Steven Cheng
>>
>>Microsoft MSDN Online Support Lead
>>
>>
>>This posting is provided "AS IS" with no warranties, and confers no

rights.
>>
>>
>>
>>
>>
>>--------------------
>>>Xref: TK2MSFTNGHUB02.phx.gbl

>>microsoft.public.dotnet.framework.aspnet.webcont rols:2217
>>>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
>>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
>>>
>>>Steven,
>>>
>>>Thanks for the reply. The initial target devices are HTML enabled - but

>>the
>>>intention was to make the pages available to more devices at a later

date.
>>>I will investigate using a standard asp.net page for now.
>>>
>>>Thanks.
>>>Woodgnome.
>>>
>>>
>>>
>>>"Steven Cheng[MSFT]" wrote:
>>>
>>>> Hi Woodgnome,
>>>>
>>>> Regarding on the ASP.NET mobile page fileuploading issue, I've

>performed
>>>> some local tests and did found the same behavior as you mentioned. It

>>seems
>>>> the Mobile Form doesn't allow us to insert our custom attributes into

>>it
>>>> like a standard htmlForm control. I've also tried manually add the
>>>> "enctype="multipart/form-data" " attribute into the mobile form and it

>>was
>>>> also ignored and runtime. BTW, for mobile devices, I notice that few

>>WAP
>>>> or xhtml mp devices support file upload element,
>>>>
>>>> http://www.developershome.com/wap/wa...asp?page=intro
>>>>
>>>> so are your web application's target devices HTML enabled? If so,

>maybe
>>>> you can consider use a standard ASP.NET page(not mobile page) to serve

>>the
>>>> fileupload functionality(since only a simple screen with some text and

>>file
>>>> upload html element are necessary), how do you think?
>>>>
>>>> Anyway, I'll also help you consult some other mobile engineers to see
>>>> whether there is anything else we can do here, I'll inform you as soon

>>as I
>>>> get any update.
>>>>
>>>> Sincerely,
>>>>
>>>> Steven Cheng
>>>>
>>>> Microsoft MSDN Online Support Lead
>>>>
>>>>
>>>>
>>>> ==================================================
>>>>
>>>> Get notification to my posts through email? Please refer to
>>>>

>>http://msdn.microsoft.com/subscripti...fault.aspx#not

i
>f
>>>> ications.
>>>>
>>>>
>>>>
>>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent

>>issues
>>>> where an initial response from the community or a Microsoft Support
>>>> Engineer within 1 business day is acceptable. Please note that each

>>follow
>>>> up response may take approximately 2 business days as the support
>>>> professional working with you may need further investigation to reach

>>the
>>>> most efficient resolution. The offering is not appropriate for

>>situations
>>>> that require urgent, real-time or phone-based interactions or complex
>>>> project analysis and dump analysis issues. Issues of this nature are

>>best
>>>> handled working with a dedicated Microsoft Support Engineer by

>>contacting
>>>> Microsoft Customer Support Services (CSS) at
>>>> http://msdn.microsoft.com/subscripti...t/default.aspx.
>>>>
>>>> ==================================================
>>>>
>>>>
>>>> This posting is provided "AS IS" with no warranties, and confers no

>>rights.
>>>>
>>>>
>>>>
>>>> --------------------
>>>>
>>>> >
>>>> >Hi,
>>>> >
>>>> >I am trying to provide the user with a file upload facility on mobile
>>>> >devices that will support it. So I have tried using the FileUpload

>>control
>>>> in
>>>> >a device specific section - as follows, but when the form posts back,

>>the
>>>> >HasFile proerty is always set to false and the file is nowhere to be

>>seen.
>>>>
>>>> >It would appear that it may be something to do with the fact that the

>>form
>>>> is
>>>> >rendering without enctype="multipart/form-data" on the form tag.

>Anyone
>>>> any
>>>> >ideas how I might get this to work ?
>>>> >
>>>> ><mobile:Form ID="NewForm" runat="server" Title="New Form">
>>>> >
>>>> ><mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
>>>> > <Choice>
>>>> > <FooterTemplate>
>>>> > <tr>
>>>> > <td>
>>>> > <asp:FileUpload ID="fileUpload1"
>>>> >runat="server"></asp:FileUpload>
>>>> > </br>
>>>> > <asp:FileUpload ID="fileUpload2"
>>>> >runat="server"></asp:FileUpload>
>>>> > </br>
>>>> > <asp:FileUpload ID="fileUpload3"
>>>> >runat="server"></asp:FileUpload>
>>>> > </td>
>>>> > </tr>
>>>> > </FooterTemplate>
>>>> > </Choice>
>>>> ></mobileeviceSpecific>
>>>> >
>>>> >......
>>>> >
>>>>
>>>>
>>>

>>
>>

>
>


 
Reply With Quote
 
Woodgnome
Guest
Posts: n/a
 
      09-13-2007
Hi Steven,

Thanks for your posts, this will be helpful if I need to get it working on
other mobile devices later.

I have managed to get it working on a standard html based ASP.NET page for
now.

However, I have now noticed that the the file name part of the file path
seams to be restricted to a maximum of 10 chars. I have tried adding the
maxLength at a custom attribute but this does not seam to have any effect.
Any ideas how I might be able to allow the user to submit longer file names ?

Woodgnome.

P.S. This is on the Windows Mobile 6 Classic Emulator.

"Steven Cheng[MSFT]" wrote:

> Hi Woodgnome,
>
> Does the further info in my last reply helps? If there is anything else we
> can help, please feel free to post here.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> --------------------
> >Date: Fri, 31 Aug 2007 04:02:44 GMT
> >Subject: RE: FileUpload Control on Mobile Form
> >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls

> ing-Host: tomcatimport2.phx.gbl 10.201.218.182
> >
> >Hi Woodgnome,
> >
> >Are you still focus on this issue? I've just got some new info. I've
> >discussed with a DEV engineer who has ever worked on a similar issue, here
> >is a workaround for mobile page to use the fileupload control. See the
> >following comments
> >
> >==================================
> >The reason upload control can't work on mobile page is the result rendered
> >by mobile page is lacking a form property: enctype="multipart/form-data".
> >
> >To inject this property you can inherit Html/Chtml/XhtmlMobileTextWriter
> >class and override their WriteBeginTag method. The override method is
> >something link below:
> >
> >public class ChtmlMobileMultipartTextWriter :
> >System.Web.UI.MobileControls.Adapters.ChtmlMobile TextWriter
> > {
> > public ChtmlMobileMultipartTextWriter(System.IO.TextWrite r writer,
> >MobileCapabilities device)
> > : base(writer, device)
> > {
> > }
> >
> > public override void WriteBeginTag(string tag)
> > {
> > if (tag == null)
> > {
> > throw new ArgumentNullException("tag");
> > }
> >
> > base.WriteBeginTag(tag);
> >
> > if (tag.Equals("form"))
> > {
> > WriteAttribute("enctype", "multipart/form-data");
> > }
> > }
> >}
> >
> >==============================
> >
> >Hope this still helps.
> >
> >Sincerely,
> >
> >Steven Cheng
> >
> >Microsoft MSDN Online Support Lead
> >
> >
> >This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> >--------------------
> >>X-Tomcat-ID: 34003249
> >>References: <(E-Mail Removed)>

> ><B5gE#(E-Mail Removed)>
> ><(E-Mail Removed)>
> >>MIME-Version: 1.0
> >>Content-Type: text/plain
> >>Content-Transfer-Encoding: 7bit
> >>From: (E-Mail Removed) (Steven Cheng[MSFT])
> >>Organization: Microsoft
> >>Date: Wed, 29 Aug 2007 03:00:00 GMT
> >>Subject: RE: FileUpload Control on Mobile Form
> >>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> >>Message-ID: <(E-Mail Removed)>
> >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
> >>Lines: 120
> >>Path: TK2MSFTNGHUB02.phx.gbl
> >>Xref: TK2MSFTNGHUB02.phx.gbl

> >microsoft.public.dotnet.framework.aspnet.webcontr ols:2222
> >>NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
> >>
> >>Hi Woodgnome,
> >>
> >>Thanks for your reply.
> >>
> >>Yes, a standard html based ASP.NET page will save much effort. Anyway,

> I'm
> >>still doing some further research on this and will inform you if I get

> any
> >>new information helpful.
> >>
> >>Sincerely,
> >>
> >>Steven Cheng
> >>
> >>Microsoft MSDN Online Support Lead
> >>
> >>
> >>This posting is provided "AS IS" with no warranties, and confers no

> rights.
> >>
> >>
> >>
> >>
> >>
> >>--------------------
> >>>Xref: TK2MSFTNGHUB02.phx.gbl
> >>microsoft.public.dotnet.framework.aspnet.webcont rols:2217
> >>>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
> >>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> >>>
> >>>Steven,
> >>>
> >>>Thanks for the reply. The initial target devices are HTML enabled - but
> >>the
> >>>intention was to make the pages available to more devices at a later

> date.
> >>>I will investigate using a standard asp.net page for now.
> >>>
> >>>Thanks.
> >>>Woodgnome.
> >>>
> >>>
> >>>
> >>>"Steven Cheng[MSFT]" wrote:
> >>>
> >>>> Hi Woodgnome,
> >>>>
> >>>> Regarding on the ASP.NET mobile page fileuploading issue, I've

> >performed
> >>>> some local tests and did found the same behavior as you mentioned. It
> >>seems
> >>>> the Mobile Form doesn't allow us to insert our custom attributes into
> >>it
> >>>> like a standard htmlForm control. I've also tried manually add the
> >>>> "enctype="multipart/form-data" " attribute into the mobile form and it
> >>was
> >>>> also ignored and runtime. BTW, for mobile devices, I notice that few
> >>WAP
> >>>> or xhtml mp devices support file upload element,
> >>>>
> >>>> http://www.developershome.com/wap/wa...asp?page=intro
> >>>>
> >>>> so are your web application's target devices HTML enabled? If so,

> >maybe
> >>>> you can consider use a standard ASP.NET page(not mobile page) to serve
> >>the
> >>>> fileupload functionality(since only a simple screen with some text and
> >>file
> >>>> upload html element are necessary), how do you think?
> >>>>
> >>>> Anyway, I'll also help you consult some other mobile engineers to see
> >>>> whether there is anything else we can do here, I'll inform you as soon
> >>as I
> >>>> get any update.
> >>>>
> >>>> Sincerely,
> >>>>
> >>>> Steven Cheng
> >>>>
> >>>> Microsoft MSDN Online Support Lead
> >>>>
> >>>>
> >>>>
> >>>> ==================================================
> >>>>
> >>>> Get notification to my posts through email? Please refer to
> >>>>
> >>http://msdn.microsoft.com/subscripti...fault.aspx#not

> i
> >f
> >>>> ications.
> >>>>
> >>>>
> >>>>
> >>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
> >>issues
> >>>> where an initial response from the community or a Microsoft Support
> >>>> Engineer within 1 business day is acceptable. Please note that each
> >>follow
> >>>> up response may take approximately 2 business days as the support
> >>>> professional working with you may need further investigation to reach
> >>the
> >>>> most efficient resolution. The offering is not appropriate for
> >>situations
> >>>> that require urgent, real-time or phone-based interactions or complex
> >>>> project analysis and dump analysis issues. Issues of this nature are
> >>best
> >>>> handled working with a dedicated Microsoft Support Engineer by
> >>contacting
> >>>> Microsoft Customer Support Services (CSS) at
> >>>> http://msdn.microsoft.com/subscripti...t/default.aspx.
> >>>>
> >>>> ==================================================
> >>>>
> >>>>
> >>>> This posting is provided "AS IS" with no warranties, and confers no
> >>rights.
> >>>>
> >>>>
> >>>>
> >>>> --------------------
> >>>>
> >>>> >
> >>>> >Hi,
> >>>> >
> >>>> >I am trying to provide the user with a file upload facility on mobile
> >>>> >devices that will support it. So I have tried using the FileUpload
> >>control
> >>>> in
> >>>> >a device specific section - as follows, but when the form posts back,
> >>the
> >>>> >HasFile proerty is always set to false and the file is nowhere to be
> >>seen.
> >>>>
> >>>> >It would appear that it may be something to do with the fact that the
> >>form
> >>>> is
> >>>> >rendering without enctype="multipart/form-data" on the form tag.

> >Anyone
> >>>> any
> >>>> >ideas how I might get this to work ?
> >>>> >
> >>>> ><mobile:Form ID="NewForm" runat="server" Title="New Form">
> >>>> >
> >>>> ><mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
> >>>> > <Choice>
> >>>> > <FooterTemplate>
> >>>> > <tr>
> >>>> > <td>
> >>>> > <asp:FileUpload ID="fileUpload1"
> >>>> >runat="server"></asp:FileUpload>
> >>>> > </br>
> >>>> > <asp:FileUpload ID="fileUpload2"
> >>>> >runat="server"></asp:FileUpload>
> >>>> > </br>
> >>>> > <asp:FileUpload ID="fileUpload3"
> >>>> >runat="server"></asp:FileUpload>
> >>>> > </td>
> >>>> > </tr>
> >>>> > </FooterTemplate>
> >>>> > </Choice>
> >>>> ></mobileeviceSpecific>
> >>>> >
> >>>> >......
> >>>> >
> >>>>
> >>>>
> >>>
> >>
> >>

> >
> >

>
>

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      09-14-2007
Thanks for your followup Woodgnome,

For the upload control, I haven't got any known of filename size
limitation(at least not 10 chars). Does this problem only occur for your
mobile devices? I've tested it on standard aspx page and PC boxes and I can
submit long-filename files. Just use the below cose to printout the
filename:

>>>>>>>>>>>>>>>>>

protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
Response.Write("<br/>filename: " + FileUpload1.FileName);
}
}
>>>>>>>>>>>>>>>>



Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

>Subject: RE: FileUpload Control on Mobile Form
>Date: Thu, 13 Sep 2007 03:44:00 -0700


>Hi Steven,
>
>Thanks for your posts, this will be helpful if I need to get it working on
>other mobile devices later.
>
>I have managed to get it working on a standard html based ASP.NET page for
>now.
>
>However, I have now noticed that the the file name part of the file path
>seams to be restricted to a maximum of 10 chars. I have tried adding the
>maxLength at a custom attribute but this does not seam to have any effect.
>Any ideas how I might be able to allow the user to submit longer file

names ?
>
>Woodgnome.
>
>P.S. This is on the Windows Mobile 6 Classic Emulator.
>
>"Steven Cheng[MSFT]" wrote:
>
>> Hi Woodgnome,
>>
>> Does the further info in my last reply helps? If there is anything else

we
>> can help, please feel free to post here.
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>> This posting is provided "AS IS" with no warranties, and confers no

rights.
>>
>>
>> --------------------
>> >Date: Fri, 31 Aug 2007 04:02:44 GMT
>> >Subject: RE: FileUpload Control on Mobile Form
>> >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls

>> ing-Host: tomcatimport2.phx.gbl 10.201.218.182
>> >
>> >Hi Woodgnome,
>> >
>> >Are you still focus on this issue? I've just got some new info. I've
>> >discussed with a DEV engineer who has ever worked on a similar issue,

here
>> >is a workaround for mobile page to use the fileupload control. See the
>> >following comments
>> >
>> >==================================
>> >The reason upload control can't work on mobile page is the result

rendered
>> >by mobile page is lacking a form property:

enctype="multipart/form-data".
>> >
>> >To inject this property you can inherit

Html/Chtml/XhtmlMobileTextWriter
>> >class and override their WriteBeginTag method. The override method is
>> >something link below:
>> >
>> >public class ChtmlMobileMultipartTextWriter :
>> >System.Web.UI.MobileControls.Adapters.ChtmlMobile TextWriter
>> > {
>> > public ChtmlMobileMultipartTextWriter(System.IO.TextWrite r

writer,
>> >MobileCapabilities device)
>> > : base(writer, device)
>> > {
>> > }
>> >
>> > public override void WriteBeginTag(string tag)
>> > {
>> > if (tag == null)
>> > {
>> > throw new ArgumentNullException("tag");
>> > }
>> >
>> > base.WriteBeginTag(tag);
>> >
>> > if (tag.Equals("form"))
>> > {
>> > WriteAttribute("enctype", "multipart/form-data");
>> > }
>> > }
>> >}
>> >
>> >==============================
>> >
>> >Hope this still helps.
>> >
>> >Sincerely,
>> >
>> >Steven Cheng
>> >
>> >Microsoft MSDN Online Support Lead
>> >
>> >
>> >This posting is provided "AS IS" with no warranties, and confers no

rights.
>> >
>> >
>> >--------------------
>> >>X-Tomcat-ID: 34003249
>> >>References: <(E-Mail Removed)>
>> ><B5gE#(E-Mail Removed)>
>> ><(E-Mail Removed)>
>> >>MIME-Version: 1.0
>> >>Content-Type: text/plain
>> >>Content-Transfer-Encoding: 7bit
>> >>From: (E-Mail Removed) (Steven Cheng[MSFT])
>> >>Organization: Microsoft
>> >>Date: Wed, 29 Aug 2007 03:00:00 GMT
>> >>Subject: RE: FileUpload Control on Mobile Form
>> >>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
>> >>Message-ID: <(E-Mail Removed)>
>> >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
>> >>Lines: 120
>> >>Path: TK2MSFTNGHUB02.phx.gbl
>> >>Xref: TK2MSFTNGHUB02.phx.gbl
>> >microsoft.public.dotnet.framework.aspnet.webcontr ols:2222
>> >>NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
>> >>
>> >>Hi Woodgnome,
>> >>
>> >>Thanks for your reply.
>> >>
>> >>Yes, a standard html based ASP.NET page will save much effort. Anyway,

>> I'm
>> >>still doing some further research on this and will inform you if I get

>> any
>> >>new information helpful.
>> >>
>> >>Sincerely,
>> >>
>> >>Steven Cheng
>> >>
>> >>Microsoft MSDN Online Support Lead
>> >>
>> >>
>> >>This posting is provided "AS IS" with no warranties, and confers no

>> rights.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>--------------------
>> >>>Xref: TK2MSFTNGHUB02.phx.gbl
>> >>microsoft.public.dotnet.framework.aspnet.webcont rols:2217
>> >>>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
>> >>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
>> >>>
>> >>>Steven,
>> >>>
>> >>>Thanks for the reply. The initial target devices are HTML enabled -

but
>> >>the
>> >>>intention was to make the pages available to more devices at a later

>> date.
>> >>>I will investigate using a standard asp.net page for now.
>> >>>
>> >>>Thanks.
>> >>>Woodgnome.
>> >>>
>> >>>
>> >>>
>> >>>"Steven Cheng[MSFT]" wrote:
>> >>>
>> >>>> Hi Woodgnome,
>> >>>>
>> >>>> Regarding on the ASP.NET mobile page fileuploading issue, I've
>> >performed
>> >>>> some local tests and did found the same behavior as you mentioned.

It
>> >>seems
>> >>>> the Mobile Form doesn't allow us to insert our custom attributes

into
>> >>it
>> >>>> like a standard htmlForm control. I've also tried manually add the
>> >>>> "enctype="multipart/form-data" " attribute into the mobile form and

it
>> >>was
>> >>>> also ignored and runtime. BTW, for mobile devices, I notice that

few
>> >>WAP
>> >>>> or xhtml mp devices support file upload element,
>> >>>>
>> >>>>

http://www.developershome.com/wap/wa...asp?page=intro
>> >>>>
>> >>>> so are your web application's target devices HTML enabled? If so,
>> >maybe
>> >>>> you can consider use a standard ASP.NET page(not mobile page) to

serve
>> >>the
>> >>>> fileupload functionality(since only a simple screen with some text

and
>> >>file
>> >>>> upload html element are necessary), how do you think?
>> >>>>
>> >>>> Anyway, I'll also help you consult some other mobile engineers to

see
>> >>>> whether there is anything else we can do here, I'll inform you as

soon
>> >>as I
>> >>>> get any update.
>> >>>>
>> >>>> Sincerely,
>> >>>>
>> >>>> Steven Cheng
>> >>>>
>> >>>> Microsoft MSDN Online Support Lead
>> >>>>
>> >>>>
>> >>>>
>> >>>> ==================================================
>> >>>>
>> >>>> Get notification to my posts through email? Please refer to
>> >>>>

>>
>>http://msdn.microsoft.com/subscripti...fault.aspx#not
>> i
>> >f
>> >>>> ications.
>> >>>>
>> >>>>
>> >>>>
>> >>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
>> >>issues
>> >>>> where an initial response from the community or a Microsoft Support
>> >>>> Engineer within 1 business day is acceptable. Please note that each
>> >>follow
>> >>>> up response may take approximately 2 business days as the support
>> >>>> professional working with you may need further investigation to

reach
>> >>the
>> >>>> most efficient resolution. The offering is not appropriate for
>> >>situations
>> >>>> that require urgent, real-time or phone-based interactions or

complex
>> >>>> project analysis and dump analysis issues. Issues of this nature

are
>> >>best
>> >>>> handled working with a dedicated Microsoft Support Engineer by
>> >>contacting
>> >>>> Microsoft Customer Support Services (CSS) at
>> >>>> http://msdn.microsoft.com/subscripti...t/default.aspx.
>> >>>>
>> >>>> ==================================================
>> >>>>
>> >>>>
>> >>>> This posting is provided "AS IS" with no warranties, and confers no
>> >>rights.
>> >>>>
>> >>>>
>> >>>>
>> >>>> --------------------
>> >>>>
>> >>>> >
>> >>>> >Hi,
>> >>>> >
>> >>>> >I am trying to provide the user with a file upload facility on

mobile
>> >>>> >devices that will support it. So I have tried using the FileUpload
>> >>control
>> >>>> in
>> >>>> >a device specific section - as follows, but when the form posts

back,
>> >>the
>> >>>> >HasFile proerty is always set to false and the file is nowhere to

be
>> >>seen.
>> >>>>
>> >>>> >It would appear that it may be something to do with the fact that

the
>> >>form
>> >>>> is
>> >>>> >rendering without enctype="multipart/form-data" on the form tag.
>> >Anyone
>> >>>> any
>> >>>> >ideas how I might get this to work ?
>> >>>> >
>> >>>> ><mobile:Form ID="NewForm" runat="server" Title="New Form">
>> >>>> >
>> >>>> ><mobileeviceSpecific ID="DeviceSpecific1" Runat="Server">
>> >>>> > <Choice>
>> >>>> > <FooterTemplate>
>> >>>> > <tr>
>> >>>> > <td>
>> >>>> > <asp:FileUpload ID="fileUpload1"
>> >>>> >runat="server"></asp:FileUpload>
>> >>>> > </br>
>> >>>> > <asp:FileUpload ID="fileUpload2"
>> >>>> >runat="server"></asp:FileUpload>
>> >>>> > </br>
>> >>>> > <asp:FileUpload ID="fileUpload3"
>> >>>> >runat="server"></asp:FileUpload>
>> >>>> > </td>
>> >>>> > </tr>
>> >>>> > </FooterTemplate>
>> >>>> > </Choice>
>> >>>> ></mobileeviceSpecific>
>> >>>> >
>> >>>> >......
>> >>>> >
>> >>>>
>> >>>>
>> >>>
>> >>
>> >>
>> >
>> >

>>
>>

>


 
Reply With Quote
 
Woodgnome
Guest
Posts: n/a
 
      09-14-2007
Steven,

Thanks for the reply.

It's just on the Windows Mobile 6 Classic Emulator. It works OK in a normal
browser.

The fileupload.HasFile property is set to false on postback.

I am guessing that maxLength attribute on the rendered <input> tag is
defaulting to 10 on the mobile device, but setting on rendering doesnt seam
to have any effect.

Woodgnome.

"Steven Cheng[MSFT]" wrote:

> Thanks for your followup Woodgnome,
>
> For the upload control, I haven't got any known of filename size
> limitation(at least not 10 chars). Does this problem only occur for your
> mobile devices? I've tested it on standard aspx page and PC boxes and I can
> submit long-filename files. Just use the below cose to printout the
> filename:
>
> >>>>>>>>>>>>>>>>>

> protected void Button1_Click(object sender, EventArgs e)
> {
> if (FileUpload1.HasFile)
> {
> Response.Write("<br/>filename: " + FileUpload1.FileName);
> }
> }
> >>>>>>>>>>>>>>>>

>
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --------------------
>
> >Subject: RE: FileUpload Control on Mobile Form
> >Date: Thu, 13 Sep 2007 03:44:00 -0700

>
> >Hi Steven,
> >
> >Thanks for your posts, this will be helpful if I need to get it working on
> >other mobile devices later.
> >
> >I have managed to get it working on a standard html based ASP.NET page for
> >now.
> >
> >However, I have now noticed that the the file name part of the file path
> >seams to be restricted to a maximum of 10 chars. I have tried adding the
> >maxLength at a custom attribute but this does not seam to have any effect.
> >Any ideas how I might be able to allow the user to submit longer file

> names ?
> >
> >Woodgnome.
> >
> >P.S. This is on the Windows Mobile 6 Classic Emulator.
> >
> >"Steven Cheng[MSFT]" wrote:
> >
> >> Hi Woodgnome,
> >>
> >> Does the further info in my last reply helps? If there is anything else

> we
> >> can help, please feel free to post here.
> >>
> >> Sincerely,
> >>
> >> Steven Cheng
> >>
> >> Microsoft MSDN Online Support Lead
> >>
> >>
> >> This posting is provided "AS IS" with no warranties, and confers no

> rights.
> >>
> >>
> >> --------------------
> >> >Date: Fri, 31 Aug 2007 04:02:44 GMT
> >> >Subject: RE: FileUpload Control on Mobile Form
> >> >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
> >> ing-Host: tomcatimport2.phx.gbl 10.201.218.182
> >> >
> >> >Hi Woodgnome,
> >> >
> >> >Are you still focus on this issue? I've just got some new info. I've
> >> >discussed with a DEV engineer who has ever worked on a similar issue,

> here
> >> >is a workaround for mobile page to use the fileupload control. See the
> >> >following comments
> >> >
> >> >==================================
> >> >The reason upload control can't work on mobile page is the result

> rendered
> >> >by mobile page is lacking a form property:

> enctype="multipart/form-data".
> >> >
> >> >To inject this property you can inherit

> Html/Chtml/XhtmlMobileTextWriter
> >> >class and override their WriteBeginTag method. The override method is
> >> >something link below:
> >> >
> >> >public class ChtmlMobileMultipartTextWriter :
> >> >System.Web.UI.MobileControls.Adapters.ChtmlMobile TextWriter
> >> > {
> >> > public ChtmlMobileMultipartTextWriter(System.IO.TextWrite r

> writer,
> >> >MobileCapabilities device)
> >> > : base(writer, device)
> >> > {
> >> > }
> >> >
> >> > public override void WriteBeginTag(string tag)
> >> > {
> >> > if (tag == null)
> >> > {
> >> > throw new ArgumentNullException("tag");
> >> > }
> >> >
> >> > base.WriteBeginTag(tag);
> >> >
> >> > if (tag.Equals("form"))
> >> > {
> >> > WriteAttribute("enctype", "multipart/form-data");
> >> > }
> >> > }
> >> >}
> >> >
> >> >==============================
> >> >
> >> >Hope this still helps.
> >> >
> >> >Sincerely,
> >> >
> >> >Steven Cheng
> >> >
> >> >Microsoft MSDN Online Support Lead
> >> >
> >> >
> >> >This posting is provided "AS IS" with no warranties, and confers no

> rights.
> >> >
> >> >
> >> >--------------------
> >> >>X-Tomcat-ID: 34003249
> >> >>References: <(E-Mail Removed)>
> >> ><B5gE#(E-Mail Removed)>
> >> ><(E-Mail Removed)>
> >> >>MIME-Version: 1.0
> >> >>Content-Type: text/plain
> >> >>Content-Transfer-Encoding: 7bit
> >> >>From: (E-Mail Removed) (Steven Cheng[MSFT])
> >> >>Organization: Microsoft
> >> >>Date: Wed, 29 Aug 2007 03:00:00 GMT
> >> >>Subject: RE: FileUpload Control on Mobile Form
> >> >>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> >> >>Message-ID: <(E-Mail Removed)>
> >> >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
> >> >>Lines: 120
> >> >>Path: TK2MSFTNGHUB02.phx.gbl
> >> >>Xref: TK2MSFTNGHUB02.phx.gbl
> >> >microsoft.public.dotnet.framework.aspnet.webcontr ols:2222
> >> >>NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
> >> >>
> >> >>Hi Woodgnome,
> >> >>
> >> >>Thanks for your reply.
> >> >>
> >> >>Yes, a standard html based ASP.NET page will save much effort. Anyway,
> >> I'm
> >> >>still doing some further research on this and will inform you if I get
> >> any
> >> >>new information helpful.
> >> >>
> >> >>Sincerely,
> >> >>
> >> >>Steven Cheng
> >> >>
> >> >>Microsoft MSDN Online Support Lead
> >> >>
> >> >>
> >> >>This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>--------------------
> >> >>>Xref: TK2MSFTNGHUB02.phx.gbl
> >> >>microsoft.public.dotnet.framework.aspnet.webcont rols:2217
> >> >>>NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
> >> >>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> >> >>>
> >> >>>Steven,
> >> >>>
> >> >>>Thanks for the reply. The initial target devices are HTML enabled -

> but
> >> >>the
> >> >>>intention was to make the pages available to more devices at a later
> >> date.
> >> >>>I will investigate using a standard asp.net page for now.
> >> >>>
> >> >>>Thanks.
> >> >>>Woodgnome.
> >> >>>
> >> >>>
> >> >>>
> >> >>>"Steven Cheng[MSFT]" wrote:
> >> >>>
> >> >>>> Hi Woodgnome,
> >> >>>>
> >> >>>> Regarding on the ASP.NET mobile page fileuploading issue, I've
> >> >performed
> >> >>>> some local tests and did found the same behavior as you mentioned.

> It
> >> >>seems
> >> >>>> the Mobile Form doesn't allow us to insert our custom attributes

> into
> >> >>it
> >> >>>> like a standard htmlForm control. I've also tried manually add the
> >> >>>> "enctype="multipart/form-data" " attribute into the mobile form and

> it
> >> >>was
> >> >>>> also ignored and runtime. BTW, for mobile devices, I notice that

> few
> >> >>WAP
> >> >>>> or xhtml mp devices support file upload element,
> >> >>>>
> >> >>>>

> http://www.developershome.com/wap/wa...asp?page=intro
> >> >>>>
> >> >>>> so are your web application's target devices HTML enabled? If so,
> >> >maybe
> >> >>>> you can consider use a standard ASP.NET page(not mobile page) to

> serve
> >> >>the
> >> >>>> fileupload functionality(since only a simple screen with some text

> and
> >> >>file
> >> >>>> upload html element are necessary), how do you think?
> >> >>>>
> >> >>>> Anyway, I'll also help you consult some other mobile engineers to

> see
> >> >>>> whether there is anything else we can do here, I'll inform you as

> soon
> >> >>as I
> >> >>>> get any update.
> >> >>>>
> >> >>>> Sincerely,
> >> >>>>
> >> >>>> Steven Cheng
> >> >>>>
> >> >>>> Microsoft MSDN Online Support Lead
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> ==================================================
> >> >>>>
> >> >>>> Get notification to my posts through email? Please refer to
> >> >>>>
> >>
> >>http://msdn.microsoft.com/subscripti...fault.aspx#not
> >> i
> >> >f
> >> >>>> ications.
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
> >> >>issues
> >> >>>> where an initial response from the community or a Microsoft Support
> >> >>>> Engineer within 1 business day is acceptable. Please note that each
> >> >>follow
> >> >>>> up response may take approximately 2 business days as the support
> >> >>>> professional working with you may need further investigation to

> reach
> >> >>the
> >> >>>> most efficient resolution. The offering is not appropriate for
> >> >>situations
> >> >>>> that require urgent, real-time or phone-based interactions or

> complex
> >> >>>> project analysis and dump analysis issues. Issues of this nature

> are
> >> >>best
> >> >>>> handled working with a dedicated Microsoft Support Engineer by
> >> >>contacting
> >> >>>> Microsoft Customer Support Services (CSS) at
> >> >>>> http://msdn.microsoft.com/subscripti...t/default.aspx.
> >> >>>>
> >> >>>> ==================================================
> >> >>>>
> >> >>>>
> >> >>>> This posting is provided "AS IS" with no warranties, and confers no
> >> >>rights.
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> --------------------
> >> >>>>
> >> >>>> >
> >> >>>> >Hi,
> >> >>>> >
> >> >>>> >I am trying to provide the user with a file upload facility on

> mobile
> >> >>>> >devices that will support it. So I have tried using the FileUpload
> >> >>control

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-18-2007
Hi Woodgnome,

Since Steven is out of office for several days, I will continue work with
you on this post.

Let me first summarize the issue so far: you're now able to make the
FileUpload work on mobile WebForm but the file name length is restricted to
10.

Would you please send me a copy of your test web project along with
detailed configuration (emulator, browser version) to me? I will try to
reproduce the issue on my side and see if we could find the root cause.
Thanks for the trouble.


Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone4,iPhone3,Ipad,Apple Mobile,Blackberry Mobile,HTC Mobile,LGMobile,Motorola Mobile,Nokia Mobile,Samsung Mobile chen selina C++ 0 07-13-2010 08:53 AM



Advertisments