socket programming?

Discussion in 'ASP .Net' started by =?Utf-8?B?TWlrZQ==?=, Jan 19, 2005.

  1. I have an asp.net web page (vb.net) that talks to another pc via a port. I
    can connect to the pc fine. When i connect to the pc via the port, its
    suppose to return me a file and then save that file to the web server under
    the web site directory. Well the file is not being saved to the folder. When
    i run the app in debug mode i can see the file coming acrossed but not being
    saved. Could this be a permission issue or something different? Has anyone
    ever done soemthing like this via a asp.net app? Now this same code for this
    class works in a winform application
    =?Utf-8?B?TWlrZQ==?=, Jan 19, 2005
    #1
    1. Advertising

  2. Hi,

    It sounds like it could well be a permissions problem. Especially if
    the same code works elsewhere.

    Does the user your website is running under have write/create
    permissions for the folder you are trying to save the error to?

    Do you get an error when trying to save the file to disk?
    Regards,

    Peter Chadwick (MCP)
    Peter Chadwick (MCP), Jan 19, 2005
    #2
    1. Advertising

  3. I'm running the web app locally right now to test it out on a web server. I
    gave the asp.net ID read/write access to the folder were it should write to.
    could it be something else? I'm not getting any write error while trying to
    save the file to disk from the web app either.

    "Peter Chadwick (MCP)" wrote:

    > Hi,
    >
    > It sounds like it could well be a permissions problem. Especially if
    > the same code works elsewhere.
    >
    > Does the user your website is running under have write/create
    > permissions for the folder you are trying to save the error to?
    >
    > Do you get an error when trying to save the file to disk?
    > Regards,
    >
    > Peter Chadwick (MCP)
    >
    >
    >
    =?Utf-8?B?TWlrZQ==?=, Jan 19, 2005
    #3
  4. Hi,

    Hmm. Interesting. So is it a case of the code runs normally but at the
    end of it there is no file created?

    I don't want to patronise you, but do you trap exceptions on the file
    output commands? I'm just struggling to think of situations where a
    file write would fail but no error would be raised?

    Have you tried stepping through the code line by line and watching all
    the variables? File content, filename, path etc.? I myself have had the
    situation of writing out a file failing before only to realise 2 hours
    later that I had the path wrong and it was working - just in a
    different folder!

    Failing that if you post your file code it may help to give us some
    clues...

    Regards,

    Peter Chadwick (MCP)
    Peter Chadwick (MCP), Jan 19, 2005
    #4
  5. I'm stepping through it again and noticed in the class file i have

    Public Event GetFile(ByVal strFilename As String)

    and where i get the file i have
    RaiseEvent GetFile(strFilename)

    and that is not being executed, any ideas on that?

    "Peter Chadwick (MCP)" wrote:

    > Hi,
    >
    > Hmm. Interesting. So is it a case of the code runs normally but at the
    > end of it there is no file created?
    >
    > I don't want to patronise you, but do you trap exceptions on the file
    > output commands? I'm just struggling to think of situations where a
    > file write would fail but no error would be raised?
    >
    > Have you tried stepping through the code line by line and watching all
    > the variables? File content, filename, path etc.? I myself have had the
    > situation of writing out a file failing before only to realise 2 hours
    > later that I had the path wrong and it was working - just in a
    > different folder!
    >
    > Failing that if you post your file code it may help to give us some
    > clues...
    >
    > Regards,
    >
    > Peter Chadwick (MCP)
    >
    >
    >
    =?Utf-8?B?TWlrZQ==?=, Jan 19, 2005
    #5
  6. Hi,

    Sorry about the delay in answering.

    I'm primarily a c# programmer so am not overly familiar with VB.NET,
    but the code you have to fire the event looks correct.

    Are you handling the event in the calling class? Have you tried
    stepping through the code - does the RaiseEvent line definately get
    called, i.e. does an error occur before that?
    Regards,

    Peter Chadwick (MCP)
    Peter Chadwick (MCP), Feb 1, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laszlo Nagy
    Replies:
    1
    Views:
    4,735
    Mark Wooding
    Jan 27, 2009
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    936
    Jean-Paul Calderone
    Jan 27, 2009
  3. Laszlo Nagy
    Replies:
    0
    Views:
    516
    Laszlo Nagy
    Feb 1, 2009
  4. Steve Holden
    Replies:
    0
    Views:
    638
    Steve Holden
    Feb 1, 2009
  5. Steve Holden
    Replies:
    1
    Views:
    691
Loading...

Share This Page