Answer the question
In order to leave comments, you need to log in
Upload and download .APK file. How to solve the problem?
Hello! Faced this problem:
<?php
require_once('system/mysql.php');
ini_set('upload_max_filesize', '10M');
if ($_SERVER['REQUEST_METHOD'] == "POST" ) {
if ($_FILES['inputfile']['error'] == UPLOAD_ERR_OK) {
$destiation_dir = dirname(__FILE__) .'/uploads/app-release.apk';
if (move_uploaded_file($_FILES['inputfile']['tmp_name'], $destiation_dir)) {
echo 'File Uploaded';
$version = $_POST['version'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = date('Y-m-d H:i:s');
$sql = mysql_query("UPDATE `application` SET `version`='$version', `time`='$time', `ip`='$ip'");
} else {
echo 'File not uploaded';
}
} else {
switch ($_FILES['inputfile']['error']) {
case UPLOAD_ERR_FORM_SIZE:
case UPLOAD_ERR_INI_SIZE:
echo 'File Size exceed';
brake;
case UPLOAD_ERR_NO_FILE:
echo 'FIle Not selected';
break;
default:
echo 'Something is wrong';
}
}
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question