Jump to content

bsprogs

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bsprogs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm getting this same error. I followed the instructions form http://www.php.net/rar. I first tried the normal installation gunzip rar-xxx.tgz tar -xvf rar-xxx.tar cd rar-xxx phpize ./configure && make && make install make install ran successful but rar_open never worked. So I tried the PECL installer to install the Rar extension, using the following command: pecl -v install rar. Still, ever after server restarts from each install, rar_open keeps returning the same error: Fatal error: Call to undefined function rar_open() in .... Any ideas? I'm running PHP Version 5.2.2
  2. Well, I think I may have solved my own issue. It turns out this problem is a hostage situation. The header and readfile functions hold the php session hostage until the readfile function is done. I'm going to close this now.
  3. Here is the header output when the download button is clicked: HTTP/1.1 200 OK Date: Sun, 22 Jul 2007 19:20:32 GMT Server: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b Cache-Control: must-revalidate, post-check=0, pre-check=0, private Content-Disposition: attachment; filename="Lotus_Website_Project.zip" Content-Transfer-Encoding: binary Expires: 0 Pragma: public X-Powered-By: PHP/5.2.2 Content-Length: 71035 Keep-Alive: timeout=60, max=494 Connection: Keep-Alive Content-Type: application/zip I also tried to open two windows (same browser), both set to my website. Once a download from one browser window begins, the other browser can no longer navigate the website as well. Using two different browser windows however, will work. If I use IE and FF, I don't get the issue. So this is not an IP restriction issue.
  4. Thats how I do it as well. For some reason no matter what I try, once they start downloading a file, they can't navigate the website. I'm still guessing it's because the header is being used while the whole file downloads. Then once it's complete, the header is free again? Does that make sense or does the header function not work like that?
  5. I'll try messing around with a few ideas to see what I can get to work. The hardest part is that I need to keep the original file location hidden from the user
  6. Loading a new window doesn't do anything different I'm getting off work in 10 minutes so I'll try the chunks when I get home. The rest of that page will load, it's that once it loads and the download begins, you can't navigate the website until the download is done, whether complete or canceled. As for more code, thats the only code on the entire page that has anything to do with the page downloading. Hmm, I may have a new idea!
  7. I just tried it but no luck. The download works as normal but once the download begins, you can't really do anything with the website until it's either done downloading or canceled :-/ I wonder if it could be anything other than a header problem?
  8. When the user goes to the download page, it displays a button. that button posts to $_SERVER['PHP_SELF'] then as the page is reloaded, it runs the script that I have posted above. I'mm give running it in another window a shot. It's just a pain to have the new window popup.
  9. I've got a file hosting website that has been working great for the 3000 files that have been uploaded by my members. This morning I discovered that once you click on the download link, the file will download, but you can not go back to the website until your download is complete. The apache server is not limiting the number of connections per IP (it's set at 50 right now) Here is the main part of the code I'm using. Everything works and downloads great. header('Content-type: ' . $fileDownloader->mime_get_type($file)); header("Content-Length: ". filesize($file)); header('Content-Disposition: attachment; filename="' . $v_name . '"'); header("Content-Transfer-Encoding: binary\n"); readfile($file); Being that everything else works great, I;m guessing this is a PHP header problem. Once the download is complete or canceled, the page loads no problem.
  10. Hmm, I tried your suggestion but no luck. I still can't even get the $_SESSION['variable'] information back from the server. When not using ajax but a normal link, it'll show the variable is set. However, when loading that same page in AJAX, it shows up blank.
  11. I have my own little file hosting website and once a file has been displayed, it give you a link to "Get Link codes" which will supply the BB and HTML code for the file you just uploaded. Here is a list of the files I'm using: ajax.js upload.php linkcodes.php I have my first file ajax.js var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject){ XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); } function getLinkCodes(datasource, divID){ if (XMLHttpRequestObject) { var obj = document.getElementById(divID); obj.innerHTML = "Loading..."; XMLHttpRequestObject.open("GET", datasource); XMLHttpRequestObject.onreadystatechange = function(){ if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200){ obj.innerHTML = XMLHttpRequestObject.responseText; } } XMLHttpRequestObject.send(null); } } That has worked with general tests to change the content on the page so I know the code works. Now here is the hard part. Once a file has been uploaded, the script stores a special string on a $_session Variable in PHP. Then once "Get Link Codes" is clicked, it will load linkcodes.php like this <span class=\"link\" onclick=\"getLinkCodes('tpl_linkcodes.php','maincontainer')\" style=\"font-size: 8px;\">Get Link Codes</span> When I click the link, the linkcodes.php page loads in the maincontainer just like it is supposed to. However, this is where I have a problem linkcodes.php looks something like this: <script> alert('testing'); </script> <textarea rows="15" cols="100" id="link_codes" name="link_codes" style="padding: 2px;"></textarea> The text area will load with "Info" inside it however, the alert will not pop up, nor can I print any session data that is stored in the $_session variable I was talking about earlier. I tested the code with a normal link, refreshing the page and everything and it worked like a charm. It's only when I run it without the page refresh that it wont work. Any ideas?
  12. I think I found my solution! http://blog.joshuaeichorn.com/archives/2006/03/14/php-ajax-file-upload-progress-meter-updates/ I'll have my server updated with the required files in a bit. I'll post up if I can get it to work. And I noticed that it does use the $_FILES superglobal variable and not a line of Perl code! I'll let you know in a bit!
  13. I've actually been looking at PHP progress upload bar for a few weeks now. every line on the first two pages of google results are "visited" and I've looked at the results. Each has a perl script somewhere which requires you to give a static upload directory to upload the file to before you can change information such as the file name. There are a few reasons why I dont just modify the Perl script. 1. I dont know Perl really at all. 2. Once files are uploaded in my PHP script, the script actually does quite a bit with resizing thumbs, moving files, submitting multiple database queries, populating a few session variables, passing information back to the upload page, and printing out the [bB] / <html> code back to the user.
  14. Right now is does just that. My PHP code does the following: 1. File is uploaded to temp directory 2. Generates new file name 3. writes info to database 4. moves file The CGI/Perl script I want to use (because of the progress upload bar) would require me to do it like so: 1. File is uploaded and moved via the Perl script 2. Pass $_POST information to PHP 3. Rename file 4. Write to database 5. move file again. Thats where the problem comes in. With PHP you have the $_FILES superglobal variable which holds on to that specific file. The Script I would like to use moves everything first and passes it as a POST method which, I believe, "drops" that specific file. So if two people were to upload "IMG_2002.JPG" at the same time, the script does have some possibility of renaming the wrong file or having one file overwrite the other. Is it possible to pass the upload information to a PHP form to process the actual upload while using AJAX to only keep an eye on the upload progress? This would eliminate the need for the Perl to actually upload the file. However, If I'm understanding how these AJAX progress uploaders work, the XMLHttpRequest gets progress status based on what has been uploaded via the perl Script, which isn't possible to do in PHP.
  15. I was originally using my own upload code to allow users to upload files. This was done by passing form data to a PHP page through the superglobal variable $_FILES. Now, I'm using a CGI/PERL uploader script, however, the PERL script passes the file information to my PHP pages through the superglobal variable $_POST. Now here is the fun part... I've got 200 lines of code with my PHP uploader (it does a lot more than just upload) but the whole script is based off of the values from $_FILES, not $_POST. The new CGI/Perl script that I want to use does not pass a few bits of information, such as file size, file type, etc.. through the $_POST variable. My original script will rename the file, verify information about the file, then move it from the temp directory, the submit the database information. The new script moves the files to a pre-set directory and thats about it. I know that I can adapt my PHP to take that specific file, rename it, move it, submit the database info, etc.. however, I'm slowly getting more users and as people start to use it, there is a change that two people MAY upload a file with the same name at the same time (Such as: IMG_1002.JPG from a digital camera or something). What do you guys think? The chances of this happening with two files being uploaded have less than a .0001% change of happening or is this something I should be worried about? I can work well with PHP and make it do what I need it to do, but at the same time, I want it done right with the least chance of error.
×
×
  • 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.