Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

File Download win2003 server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Harry Simpson - 03 Apr 2006 19:30 GMT
I'm using Http to pull a file from a directory in a web sevice down to the
device. Works like a champ here in the office between my XP Pro laptop (web
service on it) and my dev box.  But keep erring out when deployed at the
client's site.

I'm thinking their may be firewall or services shut down on the server
keeping me from downloading files to the device.  The client server is
Windows 2003 Server.

Any ideas on what I could try?

Harry
William LaMartin - 04 Apr 2006 02:27 GMT
Can you access this web service via Internet Explorer using your regular
computer?

> I'm using Http to pull a file from a directory in a web sevice down to the
> device. Works like a champ here in the office between my XP Pro laptop
[quoted text clipped - 8 lines]
>
> Harry
Viral - 04 Apr 2006 07:36 GMT
I am having similar problem.
I have developed web service, which is called by my application for checking
updates. If update is found then path of the related cab file is returned to
application. In application, I am programmatically downloading files on
Pocket PC by following code.

This code works fine when I configure my web service locally (local IIS). I
am able to download cab file but in case of live address this code gives
“HTTP 403 forbidden” error.

When I try to open the same cab file from pocket pc’s IE then it can be
downloaded via IE on Pocket PC, but when I try to download it
programmatically it gives error.

   'Used for creating Request.
       Dim LOC_Req As HttpWebRequest
       Dim LOC_Resp As HttpWebResponse

       ' Retrieve response stream
       Dim LOC_RespStream As Stream
       'Used Create local cab file
       Dim LOC_Wrtr As FileStream
       Dim LOC_BytesRead As Integer = 0
       ' Allocate byte buffer to hold stream contents
       Dim LOC_InData(4095) As Byte
       Try
           'Creating request
           LOC_Req = CType(WebRequest.Create(DownloadUrl), HttpWebRequest)
           'Set http-request's method to "GET"
           LOC_Req.Method = "GET"
           'Get Response.
           LOC_Resp = CType(LOC_Req.GetResponse(), HttpWebResponse)
           'Check if available space on device is less than or equal to
size of cab file.
           'Get Response's stream.
           LOC_RespStream = LOC_Resp.GetResponseStream()
           'Create a file.
           LOC_Wrtr = New FileStream(LocalFile, FileMode.Create)
           'loop through response stream reading each data block
           'and writing to the local file
 LOC_BytesRead = LOC_RespStream.Read(LOC_InData, 0, LOC_InData.Length)
           While LOC_BytesRead > 0
               LOC_Wrtr.Write(LOC_InData, 0, LOC_BytesRead)
               LOC_BytesRead = LOC_RespStream.Read(LOC_InData, 0,
LOC_InData.Length)
           End While
       Catch Ex As Exception
           'Set object of Exception. Calling application will have
           'read only access to this object.
           MsgBox(Ex.Message)
       Finally
           LOC_RespStream.Flush()
           'Closing Response stream
           LOC_RespStream.Close()
           'Closing writer stream
           LOC_Wrtr.Close()
       End Try
   End Sub 'DownloadFileBinary

Please guide me.

> Can you access this web service via Internet Explorer using your regular
> computer?
[quoted text clipped - 11 lines]
> >
> > Harry
chris-s@mailcity.com - 04 Apr 2006 09:28 GMT
Yes, I have seen this, and for the life of me I cannot remember what
caused it, I'm sure it was some configuration issue on the server. I
guess you are having the problem when pull from Windows Server
2000/2003 but not from XP, which was when we also experienced the
problem, but a bit of googling turned up the fix. Sorry I can't
remember the details but hopefully this will point you in the right
direction!

Chris
William LaMartin - 04 Apr 2006 11:08 GMT
I think what is need is something like this in the web.config file if you
want to use Get or Post

system.web>
   <webServices>
       <protocols>
           <add name="HttpPost" />
           <add name="HttpGet" />
       </protocols>
   </webServices>
</system.web>

> Yes, I have seen this, and for the life of me I cannot remember what
> caused it, I'm sure it was some configuration issue on the server. I
[quoted text clipped - 5 lines]
>
> Chris

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.