Sinisterly
[Help Me] How To Upload A File Or PHP - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: PHP (https://sinister.ly/Forum-PHP)
+--- Thread: [Help Me] How To Upload A File Or PHP (/Thread-Help-Me-How-To-Upload-A-File-Or-PHP)

Pages: 1 2


[Help Me] How To Upload A File Or PHP - vampireclanz - 04-20-2014

Topic Explain All " How To Upload File If There's No File Uploader In Some Website ? Got The Directory , and It's Showing That The Site :/localhost/dir/uploads.php size is 2700 kb ++ But There's No Option To upload File . Help Please Me Sad


RE: [Help Me] How To Upload A File Or PHP - Equinox - 04-20-2014

File uploader.



PHP Code:
echo '<b>Quick Upload:</b><form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader"><input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"></form>'; if( $_POST['_upl'] == "Upload" ) { if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) { echo '<div id="cmds">File upload success.</div>'; } else { echo '<div id="cmds">File upload failed.</div>'; } }



RE: [Help Me] How To Upload A File Or PHP - Dyme - 04-20-2014

(04-20-2014, 02:09 AM)Duubz Wrote: File uploader.



PHP Code:
echo '<b>Quick Upload:</b><form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader"><input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"></form>'; if( $_POST['_upl'] == "Upload" ) { if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) { echo '<div id="cmds">File upload success.</div>'; } else { echo '<div id="cmds">File upload failed.</div>'; } }

Lol I think you misunderstood his question...

OP you're gonna have a hard time if you don't have any knowledge of the back end code. I would suggest looking for the place on the site which utilizes the upload script (if any) and see which variables are passed to it.


RE: [Help Me] How To Upload A File Or PHP - vampireclanz - 04-20-2014

Try With The <form action="xxx.mysite.com/aaaa/dir/uploads.php" method="post" Still Won't work . Or i Should Put <form action="xxx.mysite.com/aaaa/dir/" method="post" ? Sorry Bad English .


RE: [Help Me] How To Upload A File Or PHP - Equinox - 04-20-2014

(04-20-2014, 02:22 AM)Dyme Wrote: Lol I think you misunderstood his question...

I did, however, tried my best to "decode" the message.

This is why we need to use grammar, people.

(04-20-2014, 02:25 AM)vampireclanz Wrote: Sorry Bad English .

It's fine.

As for the form action, it should remain empty.

<form action=""


RE: [Help Me] How To Upload A File Or PHP - Dyme - 04-20-2014

(04-20-2014, 02:25 AM)vampireclanz Wrote: Try With The <form action="xxx.mysite.com/aaaa/dir/uploads.php" method="post" Still Won't work . Or i Should Put <form action="xxx.mysite.com/aaaa/dir/" method="post" ? Sorry Bad English .

See what I was saying was that you need to know the correct argument(s) you have to send to the script in order for it to work.

So if the script had:
PHP Code:
$userfile_name = $_FILES['image']['name'];
Then I would have to send my file with it's name equal to "image". Like so:
Code:
<input type="file" name="image">
So if you want to upload a file, you'll have to figure out the correct name that the script is looking for. Try what I described in my earlier post in order to find this information.

(04-20-2014, 02:25 AM)Duubz Wrote: As for the form action, it should remain empty.

<form action=""
If the request was coming from the script itself, then yes. But since OP is trying to remotely upload a file via an uploader already in place on a site he does not have write access to, he will need to specify the "action" as the address to the script (E.X. http://heteroequality.com/sekret/upload.php).


RE: [Help Me] How To Upload A File Or PHP - vampireclanz - 04-20-2014

The Site Accepts All File . It's For Me neither To Find the Path For Uploading The File .. / But Now The Webmaster Had Deleted the Dir . Hurm


RE: [Help Me] How To Upload A File Or PHP - Dyme - 04-20-2014

(04-20-2014, 02:38 AM)vampireclanz Wrote: The Site Accepts All File . It's For Me neither To Find the Path For Uploading The File .. / But Now The Webmaster Had Deleted the Dir . Hurm

So upload script is gone? If so, problem solved.

lol


RE: [Help Me] How To Upload A File Or PHP - vampireclanz - 04-20-2014

lol . but I Need To Know How To Upload It . It May Come In handy in the future . Biggrin

btw , Here The Script I Use

<html>
<head>
<link href="http://www.phpletter.com/css/general.css" rel="stylesheet" type="text/css" media="screen">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://www.phpletter.com/contents/ajaxfileupload/ajaxfileupload.js"></script>
<script type="text/javascript">
function ajaxFileUpload()
{
$.ajaxFileUpload
(
{
//YOUR URL TO RECEIVE THE FILE
url: 'http://i-net.my/rojak/uploads.php/x.php',
secureuri:false,
fileElementId:'fileToUpload',
dataType: 'json',
success: function (data, status)
{
if(typeof(data.error) != 'undefined')
{
if(data.error != '')
{
alert(data.error);
}else
{
alert(data.msg);
}
}
},
error: function (data, status, e)
{
alert(data.error);
alert(e);
}
}
)
return false;
}
</script>
</head>
<body>
<form name="form" action="" method="POST" enctype="multipart/form-data">
<table cellpadding="0" cellspacing="0" class="tableForm">
<thead>
<tr>
<th>Ajax File Upload</th>
</tr>
</thead>
<tbody>
<tr>
<td><input id="fileToUpload" type="file" size="45" name="fileToUpload" class="input"></td>
</tr>
<tr>
<td>Please select a file and click Upload button</td>
</tr>
</tbody>
<tfoot>
<tr>
<td><button class="button" id="buttonUpload" onclick="return ajaxFileUpload();">Upload</button></td>
</tr>
</tfoot>
</table>
</form>
</body>
</html>
Maybe there's An Error With this Script ? o.O


RE: [Help Me] How To Upload A File Or PHP - Dyme - 04-20-2014

(04-20-2014, 02:43 AM)vampireclanz Wrote: lol . but I Need To Know How To Upload It . It May Come In handy in the future . Biggrin

btw , Here The Script I Use
-NUDERED
Maybe there's An Error With this Script ? o.O

The html form you're using to make the request doesn't matter, as long as your arguments match the target php script's code. Like I described earlier, this will determine whether or not you'll be able to upload a file.

Something as simple as the following will work, as long as the "name" parameter matches the one in the script:
Code:
<form action="http://heteroequality.com/sekret/upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file"> <input type="Submit" name="Submit" value="Submit"> </form>

Hopefully you understand. I don't know how else to explain it.