Hi Myra. Yeah, it *IS* tough to figure out wtf we all mean when we
tell someone what to do. ('we' being senior developers and such). So
much assuming in our words.

So, they told you to 'make the path relative'. Okay, so, the
background. There's two ways to specify how to find a directory on a
Windows machine: absolute and relative.

Absolute specifies all parts of the path. imd_dir =
"C:\\Inetpub\\wwwroot\\IMD\\send_files\\" specifies an absolute path
in imd_dir.

Relative is 'relative to the application's current working
directory'.imd_dir = ".\\IMD\\send_files\\" would specify a relative
path in imd_dir. The actual absolute path would depend on what the
application's working directory was, at the time the path was used.

Ignore the comments about saving on the user's computer. You don't
have to worry about that. You're CLOSE as to what your problem is, and
by now, you might even have it figured out, but...

> So it seems i  need to make the path 'relative' so the application can
> be moved from development to production servers, and their directory
> structures don't need to be the same?
>
Almost perfect. SOME of their directory structure will be the same;
but the parts you DO NOT specify, those get to be different.

The problem is that you're not saving the file where the other part of
the program wants to send it from...

>> > What happens now is a popup that says:
>> > "Internet Explorer cannot download MMH2009Q3.TXT from localhost.
>> > Internet Explorer was not able to open this Internet Site.  The
>> > requested site is either unavailable or cannot be found.  Please try
>> > again later."
>> >
Right...so there is no file at the NavigateUrl.

>> > My development box does not have the hardcoded path below but neither
>> > will the user's machines.
>> >
Nope, but as you later figured out, what you 'should' have is somewhat
the same path on your dev machine as in production...at least, from
the relative point on.


>> > i do not know what this line is doing either but i think it might be
>> > part of the problem:
>> > hlSendFile.NavigateUrl = "../IMD_MSIS/send_files/" + file_name;
>> >
Actually, this part is the solution. THIS is where the file wants to be.

>> > The code is like this:
>>
>> > string imd_dir = "C:\\Inetpub\\wwwroot\\IMD\\send_files\\";
>> >
(as a relative path that corresponds to later bits)

string imd_dir = "..\\IMD_MSIS\\send_files\\";

That should be all you need to change. Course, you should probably, in
your dev test environment, have that from your web directory yourself,
but...meh, one change, all better.

I take cookies as payment. :)

Reply via email to