MMS getfile

Started on the old forum in January 2010 · view the original in the archive · old links redirect here

12 replies · 584 views · started 16 years ago · 1 min read

5 participants
ObscureMind Junior · 10 posts #1

hi there iam with some problems with the getfile.php When i upload the file it goes to the pre configured folder but it doesnt show it and a cant download it someone could help me?

heres the script

<?
////////////////DB Details/////////////////
$dbname = "...."; 					//change to your mysql database name
$dbhost = "localhost";      						//database host name
$dbuser = "....";						//database user name
$dbpass = "....";		
//////////////////////////////////////////
$conms = mysql_connect($dbhost,$dbuser,$dbpass);
$condb = mysql_select_db($dbname);

session_start();
$_SESSION['sid']=$sid;
$fileid = $_GET["fileid"];
	$file = mysql_fetch_array(mysql_query("SELECT filename, touid FROM mms WHERE id=$fileid"));
	$uid = mysql_fetch_array(mysql_query("SELECT uid FROM fun_ses WHERE id='".$sid."'"));
        $uid = $uid[0];

	if ($file[1] == $uid){
    header("Location: mmsloads/".$file[0]);
	}
	else{
		header("Content-type: text/html");
		echo "<html><p>This file is not yours!<br/><a href=\"index.php?action=main\">Main Menu</a></p></html>";
	}
?>
Mysterio Lead · 630 posts #2

are you sure there are the dbname, dbuser and dbpass correct?

mysterio.al - programming is a functional art

WereWolveZ Developer · 51 posts #3

chm0od the folder mmsloads

With Christmas quickly approaching you’re going to need to get a gift for your werewolf lover and I’m here to help you out. Here are 10 gift ideas perfect for any fan of the furry.😌 http://vampires.com and http://darkness.com

riderz Lead · 975 posts #5

easy to fix go to ur config.php and add $mmsdir = "./mmsloads";


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

ObscureMind Junior · 10 posts #6

in the config it already is there that riderz and it doesnt work

ObscureMind Junior · 10 posts #7

Not Acceptable

An appropriate representation of the requested resource /getfile.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

This is the error

ObscureMind Junior · 10 posts #9

ive modified the gefile to this

<?
include("config.php");
include("core.php");
$bcon = connectdb();
if (!$bcon)
{
    
  echo "<p align=\"center\">";
    echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
    echo "ERRO! banco de dados em manutencao<br/><br/>";
    echo "Aguarde alguns instantes e tente novamente!<br/><br/>";
    
     
    echo "</p>";
    exit();
}

session_start();
$_SESSION['sid']=$sid;
$fileid = $_GET["fileid"];
	$file = mysql_fetch_array(mysql_query("SELECT filename, touid FROM mms WHERE id=$fileid"));
	$uid = mysql_fetch_array(mysql_query("SELECT uid FROM fun_ses WHERE id='".$sid."'"));
        $uid = $uid[0];

	if ($file[1] == $uid){
    header("Location: mmsloads/".$file[0]);
	}
	else{
		header("Content-type: text/html");
		echo "<html><p>This file is not yours!<br/><a href=\"index.php?action=main\">Main Menu</a></p></html>";
	}

and still not working it uploads and it adds it to the database but not showing the file 😢

riderz Lead · 975 posts #11

it doesnt use cron job if u check my post for mms ull find the complete code for it use it as it is then ull have no prob


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

ObscureMind Junior · 10 posts #13

i found a way to make it work withou the getfile

else if($action=="readmms"){

$pminfo = mysql_fetch_array(mysql_query("SELECT pmtext, byuid, timesent,touid, reported, filename, size, extension, origname FROM mms WHERE id='".$pmid."'"));
 addonline(getuid_sid($sid),"Vendo <i>".getnick_uid($pminfo[1])."</i>\ MMS","");
if(getuid_sid($sid)==$pminfo[3]){
$chread = mysql_query("UPDATE mms SET unread='0' WHERE id='".$pmid."'");
}

if(($pminfo[3]==getuid_sid($sid))||($pminfo[1]==getuid_sid($sid))){
if(getuid_sid($sid)==$pminfo[3]){
if(isonline($pminfo[1])){
$iml = "<img src=\"http://coding-talk.com/images/onl.gif\" alt=\"O\"/>";
}else{
$iml = "<img src=\"http://coding-talk.com/images/ofl.gif\" alt=\"O\"/>";
}
$ptxt = "<b>De</b>: ";
$bylnk = "$iml<a href=\"index.php?action=viewuser&who=$pminfo[1]\">".getnick_uid($pminfo[1])."</a>";
}else{
if(isonline($pminfo[3])){
$iml = "<img src=\"http://coding-talk.com/images/onl.gif\" alt=\"O\"/>";
}else{
$iml = "<img src=\"http://coding-talk.com/images/ofl.gif\" alt=\"O\"/>";
}
$ptxt = "<b>Para</b>: ";
$bylnk = "$iml<a href=\"index.php?action=viewuser&who=$pminfo[3]\">".getnick_uid($pminfo[3])."</a>";
}
echo "$ptxt $bylnk<br/>";
$tmstamp = $pminfo[2] + addhours();
$tmdt = date("d/m/Y h:i:s A", $tmstamp);
$diff1=time()-$pminfo[2];
echo "<b>Enviada a </b>: $tmdt<br/>".gettimemsg($diff1)." atras<br/>";
$pmtext = parsepm($pminfo[0], $sid);

if(isspam($pmtext)){
if(($pminfo[4]=="0") && ($pminfo[1]!=1)){
mysql_query("UPDATE fun_private SET reported='1' WHERE id='".$pmid."'");
}
}
switch(strtolower($pminfo[7])){
        case "mid":
        $ext = "MIDI tone";
        break;
        case "3gp":
        $ext = "3GP Video";
        break;
        case "amr":
        $ext = "AMR Audio/Recorded Voice";
        break;
        case "wav":
        $ext = "WAV Audio";
        break;
        case "mp3":
        $ext = "MP3 Audio";
        break;
        case "jpg":
        $ext = "JPG Image";
        break;
        case "gif":
        $ext = "GIF Image";
        break;
        case "png":
        $ext = "PNG Image";
        break;
        case "bmp":
        $ext = "BMP Image";
        break;
        case "exe":
        $ext = "Windows Executable file";
        break;
        case "zip":
        $ext = "Compressed ZIP Archive";
        break;
        case "rar":
        $ext = "Compressed RAR Archive";
        break;
        case "sis":
        $ext = "Symbian Application";
        break;
        case "jar":
        $ext = "Java Mobile Application";
        break;

}
$file = mysql_fetch_array(mysql_query("SELECT filename, touid FROM mms WHERE id='".$fileid."'"));

echo "<b>Mensagem</b>:<br/>".$pmtext."</br>";
if ($pminfo[7]=="gif"){
        echo "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
}
if ($pminfo[7]=="jpg"){
        echo "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
}
if ($pminfo[7]=="bmp"){
        echo "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
}
if ($pminfo[7]=="png"){
        echo "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
}
if ($pminfo[7]=="mid"){
        echo "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
}
if (($pminfo[7]=="amr") && ($pminfo[6]<100)){
        echo "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
}
if (($pminfo[7]=="mp3") && ($pminfo[6]<100)){
        echo "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
}
if (($pminfo[7]=="wav") && ($pminfo[6]<100)){
        echo "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
}
echo "<br/><b>Ficheiro</b>:<br/>".$pminfo[8];
echo "<br/><b>Tipo de Ficheiro</b>:<br/>".$ext;
echo "<br/><a href=\"mmsloads/$pminfo[5]\">Download</a><br/>";
echo "<a href=\"inbox.php?action=sendmms&who=$pminfo[1]\">Responder</a><br/><a href=\"inbox.php?action=sendpm&who=$pminfo[1]\">Responder por pm normal</a>";
echo "<p>";
echo "<b>Acao</b>: <form action=\"inbxproc.php?action=mproc\" method=\"post\"><select id=\"inputText\" name=\"pmact\">";

echo "<option value=\"del-$pmid\">Deletar</option>";
if(isstarred($pmid)){
echo "<option value=\"ust-$pmid\">Nao Guardar</option>";

}else{
echo "<option value=\"str-$pmid\">Guardar</option>";
}

echo "<option value=\"rpt-$pmid\">Reportar</option>";

echo "</select>";
echo "<br/><input id=\"inputButton\" type=\"submit\" value=\"ir\"/>";
echo "</form>";
}else{
echo "This PM ain't yours";
}
echo "<br/><a href=\"inbox.php?action=mmsdisp\">Voltar</a></br>";
echo "<center><a href=\"index.php?action=main\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Pagina inicial</a></center>";
  echo "</p>";
} 

insted of: getfile.php?fileid=$fileid i used the mmsloads/$pminfo[5] the $pminfo its already declared so i took the values from the db from there 😀

Sign in to reply.

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close