« first day (1413 days earlier)      last day (3539 days later) » 
00:00 - 19:0019:00 - 00:00

7:01 PM
@juanvan This seems wrong.
            using (Stream stream = request.GetResponse().GetResponseStream())
                using (StreamReader reader = new StreamReader(stream))
                {
                    HttpResponse response = HttpContext.Current.Response;
                    response.AddHeader("Content-Disposition", "attachment; filename=Signature;");
                    response.TransmitFile(reader.ReadToEnd());
                    response.Flush();
                    response.End();
                    return true;
 
3 responses down
 
7:29 PM
Thank God It's Friday
 
Still have 2.5 hours here
 
using XDoc to read xml files, and after 14k of them my program gets too big and crashes :(
anyone know a work around?
 
@juanvan ?
 
I am processing a bunch of XML files - and after parsing and putting them to a DB my project keeps expanding - at 1.8gb of ram right now
GC is not doing its job or could I have that many leak connections?
 
@juanvan That doesn't look right does it?
@juanvan You have your parser wrapper in using?
 
7:38 PM
yep
 
Do you use unmanaged code in any part of the process?
 
ADO
old school access :-p
going to check my disposes after it crashes see if I have them all right in the finally blocks
 
How could I correct?
 
That really doesn't look like GC's fault
 
Is there an error message when your application crashes ?
 
7:42 PM
Ya - got to blame someone - its friday
out of mem - I set up a Breakpoint in the catch to see what I have in the error obj
Gregg - need to put it to a byte array to return - can put into a MemoryStream to return?
 
@juanvan ???
Everytime I hit response.TransmitFile it crashes.
 
hi guys , in DownloadFile method of WebClient I have the error of the path is too long because my url is more than 260 character, how can I solve?
 
Did you clear the response stream first?
What does the return block look like?
 
@juanvan What I posted is what I did, I'm so brain dead at the moment. I'm sure I'm making careless errors.
 
@KeremZaman That's because DownloadFile calls GetFullPath
You could write your own WebClient, or maybe write the file to a temporary folder then move it?
 
7:49 PM
Response.Clear() at the top .Flush after the .TransmitFile
.Clear - .Header - . Content - TransmitFile()
But you need to put reader to a file - a reader stream can't be transmitted
 
Still breaks... Is it not liking how I'm reading the stream.
So, should I put memory/
 
@RodrigoSilva I can't write file to a temporary folder because when I try to save it there , I will get same error because of length of URL. How can I weite my own WebClient? Isn't it difficult?
 
ya you can try a bytearray
@gregg use response.WriteFile - if you can point right to the file on the AS400 to put to the method?
 
@juanvan Can you do an example?
 
looking over the MDSN on the response class - MDSN
nm is the same thing - if you could point to the file location in the code - for the response..
 
8:01 PM
@KeremZaman Can't you just shorten the string?
 
@RodrigoSilva Unfortunately, but now I am trying to get file withh WebRequest and WebResponse
 
8:35 PM
@Greg Good luck - beer awaits!
 
8:46 PM
@KendallFrey Are you there ?
 
@DavidKhuu oy
 
@KendallFrey Hey :)
I did some studies about WCF ...
I managed to reach the event part / duplex
I guess this is what I need, but I have a question
If I were to self host a service (using the ServiceHost class), would others be able to reach me ?
 
Depends if/how you make yourself available
 
I guess others could build the address part dynamically (of the end point ?), but when I used Unity 3D to make a multiplayer game, I remembered there was a pain the ass
 
It's basically the same concept as HTTP
 
8:52 PM
Something called NAT punchthrough
My main fear is that I don't know if relying on a an IPV4 is enough. Would it be possible to initiate communications with someone if I knew his ip address ? Don't I need a master server ?
(in Unity 3D, a master server is a server that runs a process. Anyone can easily connects and query the list of connected people)
 
If they have a server process listening to the IP address and port you connect to, you can establish a connection.
I think WCF is just HTTP, which is just TCP.
 
:')
The thing is, aren't we all hidden behind firewalls that would prevent us from connecting to each other ?
 
By default, probably yes
Unless you tunnel through it, you'd need to allow inbound connections on the server
P2P in general is much more complicated than client/server
 
Do you have any documentation or link about 'tunneling' ?
 
I had a feeling you'd ask about that, because I made it sound like a simple foolproof solution.
It's not.
 
9:06 PM
Don't worry, I know Internet is complicated
That's why I enjoy WPF and writing desktop applications instead :D
 
I've never done it, but I think what I'm thinking of is possible. I think it also requires a main server to set up.
 
9:20 PM
@KendallFrey that error might be something to do with ReachFramework.dll (aka PrintCapabilities)
 
Can I get some help, why won't this download?
        var request = WebRequest.Create(uri) as FtpWebRequest;
        if (request != null)
        {
            request.Method = WebRequestMethods.Ftp.DownloadFile;
            request.Credentials = new NetworkCredential(@"dev", @"dev");
            using (Stream stream = request.GetResponse().GetResponseStream())
                using (StreamReader reader = new StreamReader(stream))
                {
                    HttpResponse response = HttpContext.Current.Response;
                    response.Clear();
 
9:40 PM
did the ftp block your IP?
 
@NETscape No, it just shows these weird symbols and stuff.
@NETscape I just want it to write to the client.
As if you just clicked to download a link.
 
what shows these weird symbols and stuff
 
Server Error in '/' Application.

'�����ExifII*2b� ������i�v2014:06:23 11:25:06���C


��C		��� "��
���}!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
���w!1AQaq"2�B����	#3R�br�
When it hits the WriteFile or TransmitFile
 
9:58 PM
@NETscape Any thoughts?
@NETscape It is an image file, is that why?
 
uhh
you're trying to send an Ftp site Http?
 
10:18 PM
@NETscape I'm trying to download the file through FTP to the client.
@NETscape What should I be doing?
 
if you connected to an FTP site you have to talk FTP and it's going to talk FTP back.
thats like you talking to me in french and i talk to you in hebrew. we probably don't know what each other are saying and it'll all be gibberish
 
@NETscape How can I correct it?
I can get to the reader.ReadToEnd() but that doesn't do much for me.
 
you can google it ;)
this guy seems to know what he's doing
4
Q: Upload file on ftp

R.D.I want to upload file from one server to another ftp server and following is my code to upload file but it is throwing an error as: {"The remote server returned an error: (550) File unavailable (e.g., file not found, no access)."} This my code: string CompleteDPath = "ftp URL"; string U...

 
@NETscape That is Upload not Download.
@NETscape I've been trying to figure this out most of the day, I can't find any good documentation.
 
@Greg
12
Q: FtpWebRequest Download File

pm_2The following code is intended to retrieve a file via FTP. However, I'm getting an error with it. serverPath = "ftp://x.x.x.x/tmp/myfile.txt"; FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverPath); request.KeepAlive = true; request.UsePassive = true; request.UseBinary = true; ...

 
10:29 PM
@NETscape Yeah, but that doesn't explain why my code doesn't work as it is almost identical.
 
sure it does
you're writing the file back to the FTP server
 
But even when I do local data, I get Access Denied.
 
Me: Hi I'm FTP server
You: Hi, give me this file if you have it
me: here's the file
You: Thanks, I'm going to write it right back to you in HTTP
@Greg and the other thing... lawl
StreamReader
thiers:
using (Stream responseStream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(responseStream))
using (StreamWriter destination = new StreamWriter(destinationFile))
yours:
using (Stream stream = request.GetResponse().GetResponseStream())
    using (StreamReader reader = new StreamReader(stream))
 
if you're trying to read, why write to the reader that the FTP site gave you?
 
10:36 PM
I was just following an example.
 
yeah, that's downloading a file and doing nothing with it
except writing it to console
 
Well, I want to download it to another machine.
 
you need to save the file using a StreamWriter and name the file with the appropriate extension
 
@NETscape Well, what would treat it like a normal download from a link?
 
you have to write it...
12
A: FtpWebRequest Download File

Mark KramI know this is an old Post but I am adding here for future reference. Here is a solution that I found: private void DownloadFileFTP() { string inputfilepath = @"C:\Temp\FileName.exe"; string ftphost = "xxx.xx.x.xxx"; string ftpfilepath = "/Updater/Dir1/FileName.ex...

its not an http web server where you can just say gimme this file and put it here... FTP sites are stupid, you have to do it differently
 
10:47 PM
They all use the WebClient, rather then the FTP request.
Hm.
@NETscape So it just reads to end for no reason, doesn't do anything?
@NETscape And when I do try and write it, it still fails with denied access.
 
11:13 PM
It would read a text file and write it to console.
You need to read a file and save it as an image file.
 
So I need to convert it into a byte okay, I'll play with it later tonight
ttyl
Thanks for your help.
 
There's something about denied access in that SO post. And you need to have file creation/write access to wherever you're trying to write
 
I have finally found the most painful thing a Man can do to his body
 
11:34 PM
g'evening
need a little bit of help
    private IEnumerable<Entity> PipelineInvalidProgramContractPaymentPlan(IEnumerable<Entity> entities)
    {
        if (entities == null)
        {
            Logger.WarnFormat("Entities is null");
            return Enumerable.Empty<Entity>();
        }

        var entityKeyList = entities.Select(x => x.Key).ToList();
how could I get NullReferenceException in the last line?
System.NullReferenceException: Object reference not set to an instance of an object.
Fudge, damn
the IEnumerable occassionally contains a null between other elements
 
want to try && entities.Count == 0 see if that helps?
 
00:00 - 19:0019:00 - 00:00

« first day (1413 days earlier)      last day (3539 days later) »