darshan_atha has asked for the wisdom of the Perl Monks concerning the following question:

hi monks. I have written script for downloading a report and allowing it to save directly into txt file on user machine without saving into server,now the problem is when the records are larger than the file what it is allowing to save does't contain anything and when the record is less then it is working fine.I think that there is buffer problem can anybody help me out of it. thanx in advance.

Replies are listed 'Best First'.
Re: download problem
by cLive ;-) (Prior) on Nov 12, 2002 at 07:46 UTC
    Please post some code. It is very hard to guess what your problem could be without seeing how you've written the script.

    cLive ;-)

      (print "Content-Type: application/x-unknown\n"; print "Content-Disposition: attachment; filename=\"file.txt\" \n\n";) i am using these features when someone click on download i dont print content/type ->text or html instead i print the above code and after that i query the database and fetch the record and print it in while loop of using fetchrow_array till the record ends in that case when the records r less the code is working fine but in case of large records it ask me to save the file but the file i save contains 0 byte. thanx
        Please use <code>...</code> tags around your code sample when posting - it makes it a lot easier to read!

        And once again, there is no point showing only one line of code. Just because this is where you think the problem is, it doesn't mean that it is there.

        it might also be useful to see an example of data that prints OK, and data that fails, if you can provide them (or link to them on another server if they are quite large.

        cLive ;-)

Re: download problem
by Ananda (Pilgrim) on Nov 12, 2002 at 10:42 UTC

    From what you have said it appears,that you have messed up with the code that's supposed to write to the buffer. please do post the code so that the error may be precisely pointed out. In case you donot want to share the exact variables/ inputs .... , replace them with dummy data. Anandatirtha