I have two sites with the same content on the same server but under two different IP addresses (which I suspect may be the problem) On user photo uploads, they fail on the new site that's under a different IP though the database and ever ything else is fine. They use the same photos with a symbolic link and the upload path is for the original site. So I suspect that its a php or Unix permissions issue with uploading from a different IP address.
I use this PHP upload script that uses Ajax: [URL] Really great script. However, when people upload a file over 40 MB (or maybe after a specific amount of minutes) the upload fails at 100%, when I check the Ajax-response I see a "500 Error". I checked the global error_log and per-site error_log, couldn't find any error there. php.ini max filesize is 300M, post max size is also 300M. php.ini max execution time is 0. All of these values are in the global php.ini.
Although I realise there are different approaches to securing upload process, I'm still confused when it comes to basic principles. I want to allow users to upload any kind of file they want, but keep my app secure. So my question is: Is it sufficient to store the files with their original names in 'uploads' folder outside 'webroot' and fetching them via some download.php script?
If it't not secure enough, please point me in the right direction, or suggest what additional steps I should take to make it safe.
I have a site that is receiving 30-40k photo uploads a day and I've been seeing an issue pop up with more frequency now. This issue is this:
Our upload script receives (via $_FILES['name']['tmp_name']) a file (photo) that was NOT uploaded by the user & the majority of the time the file received is a "partial" upload.
Of course at first I thought it was my PHP code making a simple mistake and I've spent days looking over it to make sure, but after placing checks in the code I've found that the file received via a HTTP POST upload to PHP is actually the wrong file. So the issue is happening before it reaches my code. The tmp file (phpxxxx) received by the script is sometimes incorrect, as if it was somehow being overwritten by another process and its usually overwritten by a file that was partially uploaded.
Has anyone every seen an issue like this? Any help is greatly appreciated. I'm turning to this as a last resort after days of searching/asking other PHP devs
So to recap:
User uploads a photo PHP script receives a file that was not uploaded by the user (pre code, via $_FILES in /var/tmp) Usually the incorrect file received is a partial upload or a broken upload It seems to happen randomly and not all the time
I have written an ftp script. When I execute it, the file is recognized by the script, the remote server is connected, and the ftp user is able to log in. However, I have only been able to upload one particular file and no others. I know this is weird, but the only file that it will accept is the source code of the script itself. It transfers this file with no problems.
This is a weird problem. At the risk of spamming my code and iritating people, in order to save time, I will go ahead an post the code for this script.
I know this question has probably been asked before but i cant find any definitive answers anywhere.. Performance wise what is the maximum file size that can be uploaded by php? I know that you set it in php.ini file and i have full control of the server so i can change these settings when needed.
The program i am going to make is like a drop box for files between 50mb and 200mb, would this be a problem doing it with PHP upload? would any other applications be put at risk of shutting down if the user is uploading files? are there any modules / applets that would help the running of the upload system (animation to show how much has been uploaded?). Plus any other problems that i may come accross.
I'm writing an uploading page for a website I'm working on. This website will hopefully allow users to upload files of up to 100MB in size. The web administrator has increased all the limiting variablies in php.ini such as:
MAX_FILE_SIZE within the uploading form is also set to 150MB.
However if I try to upload a file greater then 20MB from a PC within my companys office i get an error message saying that the request is too large for our web cache. I'm also told that if other users have a web cache between them and their internet connection they could experience the same problem.
Does anyone know a way round this problem? Is it possible to bypass the web cache somehow so that this dosent happen?
I have been trying to figure out how to make thumbnails with GD2. However, I just can't seem to get it. Can anyone tell me how to modify this code to create a thumbnail (and keep the picture intact)? I have found some references, but most are either for imagemagic, or running a sepperate script on to "batch" create thumb nails.
If not.. then how about making it allow more than one picture upload... can I just add another form field and add another variable... PHP Code:
I'm making a uploader for a form. I have a form that is sending variables to the following upload phpscript which also updates the name of the file into a database. The problem is that the file is being uploaded and updated into the database but the file is empty. It is just the name that is being uploaded into the directory and not the actual file. If anyone has any advice I would greatly appreciate it. Here is the code:
When using the new $_FILES var how do you use it for multiple uploads. Does it become a 3 dimensional array or not?? Say if I were to find the name of file number 3 in my upload would I do it like this? PHP Code:
I'm creating a photo contest script where people can submit entries through a form. The PHP script works on my server.
I want to be able to test it locally on my computer. I have Apache HTTP Server 2.0.48, PHP 4.3.4 and MySql installed and they work fine with all other PHP scripts I have. But I'm unable to "upload" locally in my computer. Code:
I have a form in which I want people to insert info and then add some pictures. All of it is to go into a mysql database so that later I can present it later in a different format. My problem is that I can't seem to merge a standard uploader in with the form I have.
I am building a community website. It will have a Content Management System that I am building myself. I will be building an Admin Control Panel dat will allow admin to "approve" members so that certain ones can become authors and submit articles through the CMS. Now here is my dilema. Once they are approved, I want a directory to be created (which will reflect the users screenname) so that all the images that they load related to their articles can be loaded there.
1. What is the best way to create these directories? (FTP or MKDIR) 2. What is the best way to upload the files? (securely) 3. Any suggestions or pointers on how to allow users to include these images in their articles?
Here's one thing that I don't know much about - file uploading. As part of my project, I will have to build a file manager of sorts - perhaps a document manager. Anyhow, this involves allowing my user to upload files to a location. I know PHP can do it - I know this because it sure does everything else. but I don't know this from any authoritative source. can you tell me if PHP can handle files uploads, and if so, what are the drawbacks that you might have learned of in your experience? For instance, in the ASP world, using a COM object for the upload works, but apparently has significant impact on performance.
I know that you can get the actual mime type of a valid image file in the getImageSize() array's 3rd element since the mime type header in the $_FILES array can be spoofed, but what if I want to handle uploading of mp3 files (or anything else, for that matter)? Is there a way to arbitrarily get the mime type of an uploaded file? I know that I could probably find documentation for the structure of each file type that I want to handle and then parse the binary data to grab the file type, but I'm not experienced in that type of programming, and I'd like to find a more elegant solution.
im trying to make a very very simple news blog where via one form/textarea i can enter both a couple of comment-lines and enter a URL/textlink (in the same textarea). the result being a link inside a text block. i know how to do it with separate inputs but cant figure out how to do it in one go.
I am currently trying to write a simple PHP script that will split an uploading file up into 500kb "chunks", then read and concatenate them back together when accessed for download. I can't seem to be able to find a way to split the file purely in PHP while it is in the middle of uploading using the move_uploaded_file function. I am trying to get it to store the file like so:
MySong.mp3 3mb gets uploaded to my server in this format:
I can easily upload a file of 500k but it fails on a file of 2.7Mb with "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 13056 bytes)" I'm confused as I've looked all around the web for solutions and it seems I've covered all bases with my ini settings?
["file".$i] indicates file "upload slots" on the page. I am concerned with ["tmp_name"], is this a string or an indicator to PHP file upload handler, I am worried what will happen if two concurrent user uploads files will the file get mixed up? If so I can try to device a way by replacing ["tmp_name"].
I have a form that has a few file fields, and when submit is clicked, they all get uploaded. But when a field is left blank, everything screws up. I though using an if statement would work, like PHP Code:
It seems my file uploads arnt working, ive taken snippets from a working script to do the following:
copy($_FILES['userfile']['tmp_name'], $imageDIR.$_FILES['userfile']['name'])or die("Could not copy");
I have various tests surrounding that snippet confirming submission of the file etc reports no errors, just wont upload the file to temp dir or the one i set as copy location. Changed and check php temp file dir and nothing is loaded in there either.