By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

socket programming?

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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)
pe**@code-explorers.com

Nov 19 '05 #2

P: n/a
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)
pe**@code-explorers.com

Nov 19 '05 #3

P: n/a
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)
pe**@code-explorers.com

Nov 19 '05 #4

P: n/a
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)
pe**@code-explorers.com

Nov 19 '05 #5

P: n/a
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)
pe**@code-explorers.com

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.