473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

File Access Denied in PDA(IE Mobile Ver. 5)

My web application need to get file size and file contents of the file the user will be selecting.

It was throwing error on
FileInfo fileInfo = new FileInfo(pathSource);
return fileInfo.Length.ToString();

I thought it was due to CAS
and so included
assembly:PermissionSetAttribute(SecurityAction.Req uestMinimum, Name = "FullTrust")]

It started working fine in my system,even with remote access to the appln.

But it throws an error if the application is accessed via PDA(with IE mobile ver 5) when the user selects a file say 'Test.txt' available in the user's PDA.
Throws an error 'Cannot find the file \...filepath...\Test.txt

Pls let me know the possible way to enable my application to get the details of the file the user may select from the user's harddisk(PDA in this case)

Or should I change any security setting in PDA?
Or is there a way allow this permission thro' ASP.Net code?

Thanks in advance.
Dec 5 '08 #1
8 2222
Plater
7,872 Expert 4TB
Your FileInfo code ONLY runs on the server of the web application.
Unless you have installed the application onto the PDA, it should always fail because the files are on the PDA not the server
Dec 5 '08 #2
Hi Plater
Please let me know how then to access the files (read file content) in PDA.
I have removed the FileInfo.The code below


//returns the stream of the filefor which path passed
Stream a = ReadStream(txtFilePath.Text);
Label1.Text = a.Length.ToString();

works fine in my system.
But it throws an error if the application is accessed via PDA(with IE mobile ver 5) when the user selects a file say 'Test.txt' available in the user's PDA.

Throws an error
System.IO.DirectoryNotFoundException:could not find a part of the path 'c:\SD-MMCard\Test.txt'

The file selected from PDA is \SD-MMCard\Test.txt
But it gives a message as tho' it is located in C drive.
Pls let me know how to read the file the user may select from the user's harddisk(PDA in this case)
(FileUpload is not supported in IE mobile ver 5.0 - which is my actual requirement/task)

Do I need to change some setting in PDA?
Or can this be trapped in ASP.Net code itself?

I have also tried giving:
<trust level="Full" />

Pls help me.

Thanks
Lizy
Dec 8 '08 #3
Plater
7,872 Expert 4TB
Your users will have to upload the file to you.
The FilUpload control might be a good control to look at for this task.
Dec 8 '08 #4
Curtis Rutland
3,256 Expert 2GB
Yes, can you imagine the security risk if servers were able to remotely browse client's file systems?
Dec 8 '08 #5
I have tried using <asp:FileUpload... and <input type=file ...
But this works only in IE.
The PDA with IE Mobile version 5.0 does not support this.
I am able upload only XML or zip file. Otherwise
the HTTPFileCollection does not contain any file after browsing & selecting files
and it throws an error when trying to retrieve from PostedFile.


I debuggeg and found
Request.Browser.Capabilities["supportsFileUpload"] returns False (for IE 6 it returns True)

Request.AcceptTypes returns only */* --> wheras IE 6 returns many others(jpeg,giff,bmp...xls...) along with this

It there is a way around for this please let me know asap.

Thanks
Dec 9 '08 #6
Plater
7,872 Expert 4TB
Unless there is some setting in ie5 that you can change to allow support for it, no I don't think there is. At least not a web based solution.
You might be able to write a regular app that uses socket calls, but that seems like it would be more likely to be blocked on that pda
Dec 9 '08 #7
Thanks for your replies. After trying regarding FileUpload control I thought the work around to upload file in PDA will be like reading the files the user selects and saving it in database
But this gives message as I have said in my prev post
'System.IO.DirectoryNotFoundException:could not find a part of the path'
(but works fine in PC).Please let me know how I can trap this error .Otherwise said How can I accomplish this task of reading files in PDA.Please help me.

Please let me know if I can move in this direction

or is it that its not the correct way of proceeding as InsertAlias has pointed out about security risk if servers were able to remotely browse client's file systems

or any other workaround that can be done to accomplish this.

Your solution & suggestion will be really of much much help.
Thanks in advance.
Dec 10 '08 #8
Plater
7,872 Expert 4TB
AGAIN....your backend code ONLY RUNS ON THE SERVER, it does not run on the client.
If the FileUpload is blocked by the PDA, and you must have file uploads.
It might be time for a new pda, or time to upgrade the software on it.
Dec 10 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: JP | last post by:
I have the need to be able to access the IE5+ favorites menu, read the title and URL for each shortcut so I can render the person's favorites list on a web page. The project I'm working on is...
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
0
by: James Nong | last post by:
I built an ASP.NET mobile web application last year for fun and hosted it on my home server. I was successful in accessing it with my Sprint phone, which uses the "Obigo 1.1.4 WAP 2.0" browser. ...
6
by: jackfoust | last post by:
I'm trying to POST from a form a simple username and password onto another website. Firefox and Opera post the data and results are returned successfully. The site returns "missing user id and...
0
by: tmeers | last post by:
Ok so a little backgroud, I have a image upload/retrieve app http://gettinlucky.dyndns.org/Shared/ that I use and have modifyed to fit my needs. (Now while I know most people shy away from storing...
3
by: Get started with Google Groups | last post by:
Hello, Hope everyone is well :-) Any help would be very much appreciated......what I want to do is use the IE 6/7 object model from within VBA (MS Access 2007) to browse to a web site, log in...
3
by: doby48 | last post by:
I have a JavaScrip that runs fine under all browsers except IE. I am opening up a document within an iframe and I get the error of Permission Denied in IE. I know that IE has security that will throw...
7
by: =?Utf-8?B?ZGlzcGxheW5hbWU=?= | last post by:
I have a Web application that is written in ASP. It runs well on regular PC. What is needed to make it run on PDA (wireless)? I want to buy a new PDA to test the application. Is there a particular...
1
by: subash.rishihar | last post by:
Is Asp.Net a right choice for Applications for PDA. Give your comments & suggestions. Thank You, Rishi........
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.