Jump to content

AtlasC1

Members
  • Posts

    38
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

AtlasC1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi everyone, I've been working on a Drupal-based Laboratory Information Management Systems (LIMS), and am having some issues with zipping files on the fly. It seems that, whenever the total content of the zip exceeds 85 MB, the download fails: the .zip file downloads, but is 0 bytes in size, and a .zip.download file also appears (which gives me the impression the download isn't complete). When I try extracting the .zip, it yields a .zip.cpgz file, which upon extracting, yields another .zip, and so on... Has anyone had an issue similar to this? Could it be timing out? It works fine for any number of files being zipped, as long as the total content is less than 85 MB (seems like the most random number ever). Here is the code that packages the files and sends them to the client: ... if ($filenames != "") { // Create temp zip file fwrite($log, "Generating unique zip filename... "); $tmp = tempnam("/birl/data/", "tempzip"); $tmp_zip = $tmp . ".zip"; fwrite($log, "[success]\n"); // We deliver a zip file header("Content-Type: archive/zip"); // The filename the client will see when downloading header("Content-Disposition: attachment; filename=bulk.zip"); // Zip the files into the tmp_zip file, note that we use very low // compression (1) to ensure rapid processing, and we get rid of paths (j), // so the zip contains only the files within those paths. fwrite($log, "Zipping files... "); $output = shell_exec("zip -0j $tmp_zip $filenames"); fwrite($log, "zip: "); fwrite($log, $output); fwrite($log, "[success]\n"); // Calc the length of the zip; needed for the progress bar of the browser $filesize = filesize($tmp_zip); header("Content-Length: $filesize"); // Keep a file pointer open, so we don't actually delete the file until the script is done $fp = fopen($tmp_zip, 'r'); // Clean up the tmp zip file fwrite($log, "Cleaning up... "); unlink($tmp); unlink($tmp_zip); fwrite($log, "[success]\n"); // Deliver the zip file fwrite($log, "Delivering to client... "); ob_clean(); flush(); fpassthru($fp); fwrite($log, "[success]\n"); } ... Note that if I comment out the calls to unlink and check the resulting .zip file, it is fully intact. So, it appears something goes wrong during the delivery process. Thanks!
  2. jQuery makes it really easy too, check out the first 'Try it Yourself' on w3c Schools jQuery AJAX. Pretty much all it involves is typing: "load('textfilehere.txt');". jm
  3. Yeah, the container of the data in jQuery has to be set to display:none; if you want it to start out in a manner that isn't visible, then have it slide down. -jm
  4. Get rid of the "quotes" around your numerical values. See if that helps. -jm
  5. Did you even read Crono's post? Again, take a look at xpdf and/or pdftohtml -jm
  6. That shouldn't matter; you can pass $count as a variable: function toggleBg(plus) { if (document.getElementById(plus).style.background=="url('/images/minus.png')"){ document.getElementById(plus).style.background="url('/images/plus.png')"; } else { document.getElementById(plus).style.background="url('/images/minus.png')"; } } and use onClick="toggleBg('plus{$count}')" I don't know what your code looks like, so I can't help you with the escape sequences for the quotes, but that shouldn't be hard to figure out. -jm
  7. Rewrite it as a function. You'll save a lot of headache, and the code will be cleaner: function toggleBg() { if (document.getElementById('plus').style.background=="url('/images/minus.png')"){ document.getElementById('plus').style.background="url('/images/plus.png')"; } else { document.getElementById('plus').style.background="url('/images/minus.png')"; } } And on the HTML element your using to trigger this event, use onClick="toggleBg();" -jm
  8. Change your css to: h2.Logo a:focus {outline: none;} And your Logo HTML to: <h2 class="Logo"><a href="index.php">WheresMyIP.Net</a></h2> -jm
  9. Try placing the height specifier in the row rather than the cell. That might work. -jm
  10. This is the first time I've seen the actual page/site as its own object. I've been doing OOP PHP programming for about 4 months now; is this common practice? Normally I take a PHP/Procedural combination, the code seems a lot less complicated. I.E: I would have a standard PHP page with HTML elements for the layout. Then, I would create a Forum object and insert that into the page. The forum object would then have classes within itself (e.g., users, posts, etc.). Maybe I should start rethinking things too... -jm
  11. Yeah, it's best to avoid any system calls whenever you get the chance. P.S: You probably have to set up an exception in SE Linux, if you have it installed, in order for a rm command to work. -jm
  12. Probably PHP. If you go to something like C or C++, you're going to have to change the way you think. Arrays behave entirely differently, as do many other things. So, unless you want to do a lot of learning, I would recommend sticking with PHP, if that's what you're comfortable with. -jm
  13. My guess is that it should probably be: <?php echo 'progress.php?user=' , $session->username ?>"> -jm
  14. Instead of outputting the string directly you could use something like wordwrap(). i.e., wordwrap($string, 88, "<br />\n", true) Is that what you're looking for? -jm
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.