Allow Uploads From Different IP?

Mar 8, 2010

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.

ADVERTISEMENT

File Uploads Over 40 MB Cause 500 Error - Smaller Uploads Work Just Fine

Jun 8, 2011

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.

View 9 Replies View Related

Uploads Folder Outside Of 'public_html' Enough To Keep Application Secure From Malicious Uploads?

Jun 3, 2010

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.

View 2 Replies View Related

Post - File Uploads Being "hijacked" By Partial Uploads?

Mar 4, 2009

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

View 2 Replies View Related

FTP Uploads

Dec 16, 2004

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.

//HMTL
<form>
<input type=file name=target_file>
<input type=submit name=submit_file>
</form>

//php
$SUBMIT_FILE = $_POST['SUBMIT_FILE'];

if($SUBMIT_FILE)
{
$filename = $_FILES['UPLOADED_FILE']['name'];
$filesize = $_FILES['UPLOADED_FILE']['size'];

$ftp_server = "server";
$ftp_login = "user";
$ftp_pass = "pass";
$remote_path = "remote_path/ftp_uploads";

if(($filename==NULL)&&($filesize==NULL))
echo "<font color="#D20000">ERROR:</font> Please select a valid file to upload.<br>";
else
{ $ftp_connection_handle = ftp_connect($ftp_server, 21);

if(!$ftp_connection_handle)
echo "<font color="#D20000">ERROR:</font> Could not establish an ftp connection.<br>";
$ftp_login_handle = ftp_login($ftp_connection_handle, $ftp_login, $ftp_pass);

if(!$ftp_login_handle)
echo "<font color="#D20000">ERROR:</font> Could not successfully login to ftp server.<br>";

ftp_pasv($ftp_connection_handle, true);

if(ftp_put($ftp_connection_handle, $remote_path.$filename, $filename, FTP_BINARY))
echo "File <b>$filename</b> uploaded successfully in BINARY format.<br>";
else if(ftp_put($ftp_connection_handle, $remote_path.$filename, $filename, FTP_ASCII))
echo "File <b>$filename</b> uploaded successfully in ASCII format.<br>";
else
echo "<font color="#D20000">ERROR:</font> File <b>$filename</b> was not uploaded.<br>";

$server_OS = ftp_systype($ftp_connection_handle);

echo "<br><br><u>File info</u><br>File: $filename<br>Size: $filesize";
echo "<br><br><u>Server info</u><br>Server OS: $server_OS";

ftp_close($ftp_connection_handle);
}
}

View 1 Replies View Related

Allows Up To 10 Uploads

Jul 29, 2007

I basically want to make an upload site, that: only allows specified extensions

allows up to 10 uploads and once uploaded, tells them the url of their file(s).

View 2 Replies View Related

Uploads

Jan 6, 2007

im having trouble with upload. i think its timing out i change the 60 to 600 still no help 2.53mb work but 2.93mb+ will not go

register_globals = off
allow_url_fopen = off

memory_limit = 50M
post_max_size = 8M
file_uploads = On
upload_max_filesize = 8M

expose_php = Off
max_input_time = 600
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
..........

View 1 Replies View Related

Max Uploads

Mar 22, 2006

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.

View 1 Replies View Related

File Uploads With PHP

Jul 17, 2005

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:

post_max_size = 150M
upload_max_filesize = 150M
max_execution_time = 600

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?

View 7 Replies View Related

Can PHP Do Multiple Uploads?

Mar 27, 2002

I would like to be able to browse to a directory, highlight several files and upload them. Is this possible or can PHP only do one at a time?

View 1 Replies View Related

Multiple Uploads

Jan 17, 2003

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:

View 3 Replies View Related

Images And Uploads

Jul 26, 2001

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:

View 2 Replies View Related

PHP 4.2.0 And File Uploads??

May 11, 2002

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:

View 1 Replies View Related

File Uploads In PHP

Feb 17, 2004

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:

View 1 Replies View Related

Multiple Uploads...

Jul 21, 2007

Im trying to upload multiple images and resize them, I can get the code to work with one upload but not 2? Code:

View 7 Replies View Related

Picture Uploads

May 6, 2006

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.

View 1 Replies View Related

Form Uploads

Jun 2, 2005

The thing is i want to stay on the same page and have it outputted there, for the rest of the image manipulation i have used javascript to simply change the src of the image i want to manipulate but ive made the src=anotherscript.php?parameters

But on the upload form if i use the post action to send it to the javascript function that changes the image src and then in anotherscript.php i get the upload info and display the image and it doesnt work. Do i hv to go straight to another page to process the script or is there a way to send the data but stay on the same page?

View 3 Replies View Related

Image Uploads

Jan 4, 2006

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?

View 1 Replies View Related

PHP And File Uploads

Jul 17, 2005

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.

View 7 Replies View Related

Partial Uploads

Jun 23, 2005

I wrote a quick admin for a site, with basic image uploads.

It was working for around 2 weeks, now suddenly it started getting buggy, then it just stopped working.

now when i upload i am getting error 3, UPLOAD_ERR_PARTIAL , the uploads are definetaly not being cancelled by the browser.

I havent come across this before so dont really know the first step to fixing it, and there seems to be no documentation into what causes this.

View 5 Replies View Related

NON-image Uploads

Nov 3, 2005

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.

View 3 Replies View Related

Form Uploads Url

Aug 25, 2005

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.

View 6 Replies View Related

Splitting Uploads Up

Sep 24, 2005

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:

/uploads/MySong/1 500kb
/uploads/MySong/2 500kb
/uploads/MySong/3 500kb
/uploads/MySong/4 500kb
/uploads/MySong/5 500kb
/uploads/MySong/6 500kb.

View 6 Replies View Related

[RESOLVED] Php.ini For Uploads

Aug 3, 2010

I have these settings in my php.ini file

memory_limit = 32M ;
set_time_limit = 3600;
max_input_time = 3600;
upload_max_filesize = 10M ;
post_max_size = 12M ;
max_execution_time = 500 ;

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?

View 1 Replies View Related

Concurrent Uploads

Aug 8, 2007

I am using the following code to upload files (3 files at one go in a single page!)

move_uploaded_file($_FILES["file".$i]["tmp_name"],"../../Photos/" .$_FILES["file".$i]["name"]);

["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"].

View 14 Replies View Related

Progress Bar During FTP Uploads

Jun 29, 2007

I have written a code which successfully uploads files using FTP in PHP however, i want to show users a progress bar about the upload. Please tell me how do it do it.

View 5 Replies View Related

Image Uploads - How To Use FTP?

Jun 29, 2007

How do i enable easy image uploads to my website/webspace by members of staff who dont no how to use FTP?

View 2 Replies View Related

File Uploads - Advanced

Jun 5, 2001

Is is possible to tell the OS what type of file to browse for?

By default the 'Files of type' is 'All Files *.*'

I'd like to set this so that it defaults to JPG file types.

View 2 Replies View Related

Multiple File Uploads

Apr 9, 2002

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:

View 1 Replies View Related

Restrict Uploads By Ip Or Session

Jun 6, 2007

I'd be very much grateful to anyone who can help me out with this problem.I've been googling for more than 2 hours with no results.

Can anyone show me how or direct me to a tutorial on:
How to restrict uploads by ip or session? I want to restrict a one user to only one upload,say per day or week or per ip.

View 1 Replies View Related

PHP File Uploads Not Working.

Dec 9, 2005

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.

View 1 Replies View Related

File Uploads And Upload_tmp_dir

Jul 17, 2005

When I was using /usr/tmp to keep the temp uploaded files,
move_uploaded_file used to fail randomly. Since I created a directory
owned by nobody:nobody (my apache user) and set upload_tmp_dir to it, I
don't have any problems. Any idea why /usr/tmp as temp upload directory
created this kind of mess? It's not a quota problem.

View 1 Replies View Related

PHP, CURL, And File Uploads

Jun 12, 2006

I am trying to write a script that makes cURL submit the following form:

<form method="post" action="script.php" enctype="multipart/form-data">
<input type="file" name="somefile">
<input type="submit" value="Send File">
</form>

I've found a few examples of how to do this, but they all require me
creating a file first. I have the data I would like to submit in a PHP
variable, and for security reasons, I would prefer not to write this to
a file.

View 5 Replies View Related

Uploads, $_HTTP_POST_FILES Is Blank

Sep 30, 2003

I'm trying out a simple file upload at the moment, I have a couple of problems:

1.) I have PHP version 4.1.1, yet it does not seem to recognise the $_FILES, but $HTTP_POST_FILES seems to work partly. The config file is as default so $_FILES should be enabled.

2.) $_HTTP_POST_FILES ['my_input_name']['name']
works OK, I get the directory etc on the local machine OK, but
$HTTP_POST_FILES['my_input_name']['tmp_name']
doesn't work, it's blank.

3.) Can I copy uploaded files to the htdocs/pics directory on my Apache web server running on XP or can I put them anywhere on the machine?

View 4 Replies View Related

Photo Uploads Into Mysql

Nov 11, 2000

How to write a php script so users can upload photos to my mysql database or tell me where I can find a good tutorial to do this ?

View 4 Replies View Related

File Uploads Not Working

Jul 17, 2005

I am trying a simple file upload, but cannot make it work on my
localhost. I wrote the following code:

$strFileDir = "/images/gallery/";
$strFileName = $strFileDir . $_FILES['fImage']['name'];
if (move_uploaded_file($_FILES['fImage']['tmp_name'],$strFileName));
{
echo ("Success");
}

....but get the following errors when uploading "gallery_1.gif":

Warning: move_uploaded_file(/images/gallery/gallery_1.gif): failed to
open stream: No such file or directory in
C:DevelopmentChasityChase.comwwwadminimageim age.php on line 16

Warning: move_uploaded_file(): Unable to move
'C:PHPuploadtempphpE4.tmp' to '/images/gallery/gallery_1.gif' in
C:Development[sitename]wwwadminimageimage.php on line 16
/images/gallery/gallery_1.gif

I am working in Windows XP Pro/IIS, in case you couldn't tell.

View 1 Replies View Related

Problems With File Uploads

Jul 16, 2005

I've written the following sourcecode:

<form action="test.php" method="POST" enctype="multipart/form-data">
<input type="file" name="datei">
<input type="submit">
</form>

// test.php
<?
echo $datei_name; // No output.
echo $_FILES['datei']['name']; // No output.
?>

View 1 Replies View Related

Ftp Uploads, And Site Issues

Sep 20, 2006

I made an little php program to upload files to my server where I am hosting a couple of webpages. The people using that php program are going to be uploading files from around 50 to 100 megabytes in size, do you think it will affect the performace of the server? Should I leave that ftp program in another server, or will it be ok?

View 1 Replies View Related

Preferred Method For Uploads?

Jun 30, 2006

What will be your preferred method of upload? Database or File Directory storage? What's the pros and cons?

View 1 Replies View Related

Text File Uploads

Aug 29, 2005

I need to be able to accept data by text files in the following format:

product_name|productid|image
Stanton SL1600|123212|http://www.com.com/images/1232.jpg
Stanton SL1601|123211|http://www.com.com/images/1231.jpg

But here's the catch, there is actually 8 possible columns and they could be ordered in any order. Code:

View 14 Replies View Related

How To Do Secure File Uploads?

Oct 15, 2007

How to do secure file uploads with php? Or, more correctly, how to upload to a secured dir? Many apps and posts I have seen on the web advise that the target dir must be writable. Now, this is ok if I am the owner of the dir, but what about if I want my users to be able to e.g. upload an image? Unless I authenticate them as an ftp user on the system, with access to the folder, the folder must be chmod 777, which is highly insecure. If I am using a shared host, which many of us are, it is not feasible for me to create an ftp login for all my users. I use session based security, and require sessions for all uploads, but if the folder is 777, anyone can just come along and browse it, and more importantly, bypass the session and write to it.

htaccess is not really suitable in my situation either, as it will use the browser popup for auth, rather than my login system and this is not consistent with the rest of the site. Once someone has logged into my site (i.e. authenticated against my db, and got a session/cookie), they should be logged in to all the areas they require access too. And how to maintain password resets etc between the db AND the htpasswd file?

Is there a way for me to use something like ftp_connect, or cURL to open a connection, possibly as a ftp user who only has access to this folder, and do some stuff like fopen(); fwrite(): or imagejpeg(); whilst the connection is open, and then close that connection?

View 4 Replies View Related

Uploads Multiple Images

Oct 17, 2006

On my PHP form i have 5 upload fields each with a unique name. This is my first attempt at creating a form which uploads multiple images so all I would like is some advice on if this approach is way off what it should be and if it is, maybe a short explanation of how it should be done? For each upload field i have this PHP code: PHP Code:

$imgA = $_FILES['uploadimageA']['tmp_name'];

        if (!empty($_FILES['uploadimageA']['tmp_name'])) {
            if (move_uploaded_file($imgA, $targetpath . basename( $_FILES['uploadimageA']['name']))) {
                $chmodpath = $targetpath . basename( $_FILES['uploadimageA']['name']);
                chmod ("$chmodpath",0644);
                $imageisuploaded = true;
            } else {
                // error message would be here...
            }
        }

Where the 'uploadimageA' references the letter A, I would change to be 'uploadimageB', 'uploadimageC' and so on. Therefore the same code is duplicated down my page 5 times but each field has a different letter making the name unique. Is this ridiculously poor? By the way, it uploads the images fine.

View 1 Replies View Related

File Size Uploads > 2MB

Jan 22, 2007

If someone wants to allow users to upload files larger than 2MB on a shared server, how could this be done? Would the script need to be written in another language such as Java or Perl?

View 4 Replies View Related

Multiple File Uploads?

Jul 9, 2005

For a small website which will be used mainly to store images during a long trip, I am looking for an easy to use method to upload many (100+) images onto a webserver. Obviously, multiple file form elements is not realistic.

The next option I found, was the use of a java applet called jupload. This however requires a java runtime to be installed., Since this person will be travelling south/central america, and may not have the option to install anything on the computers, that's not ideal either.

Is there really no good alternative for multiple file uploads? It need to be able to select several (again 100+) image files in one go, and upload them all. Can the PhP FTP tools be used for this? I could not figure out how to create the client side for it. Is also seems to be able to use only one file box.

View 8 Replies View Related

ADVERTISEMENT