Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Filebrowser file downloads corrupted?? My script or FB bug?

edited May 2007 in Vanilla 1.0 Help
I started this as a new topic, but if it's related to that header Menu that I spliced into Filebrowser, then feel free to move this back over to my header issue, which I thought I had fully solved. This seems interesting to me. I think the best way to see this issue in action is to log in, again, to the site I am constructing: www.highlandsmedicine.com and login as: user: testcase , and password: password Try to download or Save any of the testfiles I have put up there. It seems to work. However... I had to fix a few more header error messages, for this last step, which I did with output buffering ob_start() and ob_flush() commands, and now I am able to save or download the test files from the site to a local machine. It looks like everything's functioning perfectly, until you try to open the downloaded file. Upon opening the files, they are corrupted, including web page code, and gibberish. Please take a look. It's really strange. In the past, I was able to use this Filebrowser functionality without the corruption. What's going on? Any insight? Thanks in advance.

Comments

  • Options
    Its trying to put your custom header in the downloaded files?

    You probably need an IF on the line that brings in your included menu... i.e. something like IF (!$_GET['gid']) include('header.html');
  • Options
    Thanks Wallphone. I think you are right about my custom header/menu being placed in the downloaded files. That may very well be the corruption. I did a bit of research on $_GET and UID/GID to understand where you were going with that. I could not get it to work. That may be a thought path to try but I don't know how to get it working exactly thus far. Alternatively, I tried some ob_end_clean(); functions in various spots that seemed to make sense, thinking that may clear the buffer so prevent the header from being sent into the files being downloaded, but none of that worked either. I seem to have to flush the buffering right when those other header calls are made which is right after the function SaveAsDialogue is ultimately called on line 1177 for me or perhaps around line 1173 for everyone else. The SaveAsDialogue function has all of the header calls in it, which interfere with mine, which is why I buffered the header output in the first place. It's frustrating because this thing is completely functional for my customers if I can solve this last bug. There has to be a way to solve this. I wonder if I could post the code in here, so you could all see what I am doing. Since it is freeware, I doubt Mark or anyone would care overly much. It would make for a long and messy looking post, though. I really could use the help. Thanks, again, for the insight.
  • Options
    edited May 2007
    Wallphone et al., Don't waste your time looking at it. I solved it. Your advice all along has been helpful enough. Seeing that my header call coming so early in the file included the data from it into the file downloads -- thus corrupting them -- I figured I had to move the header call. Ideally, it seemed I should move it after the SaveAsDialogue function was called. In essence your earlier comments on the other link about putting it right after the body tag got me thinking along those lines, as well. Finding the right spot was the trick. Putting it in right after Mark's [ 5. Write Page Head] section seemed like a good idea and finally did work!!! Psyched! In fact, I don't even think the output buffering calls are going to be necessary this way. I did an awful lot of reading on header functions, which was probably a good education, and I still wish I knew more about the various function specifics in all of those calls. I still don't entirely understand them, the way I would like to. This was helpful: http://www.expertsrt.com/tutorials/Matt/HTTP_headers.html As was the PHP.net function descriptions: http://us2.php.net/manual/en/function.header.php I hope this may help someone else splicing a header into Filebrowser someday. Thanks for the help Wallphone!!! The little comments were enough to get me thinking and trying. You made a difference.
This discussion has been closed.