
November 4th, 2012, 11:53 PM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 16
Time spent in forums: 2 h 22 m 57 sec
Reputation Power: 0
|
|
|
How to allow users to upload files in a form?
I want users to be able to upload zip/winrar files only with a browse file input on a form. I want the files to be added to a folder on my ftp server called ../user_upload/
I have this coded in php:
PHP Code:
$string = '0123456789';
$string_shuffle = str_shuffle($string);
$half = substr($string_shuffled, 0, 3);
$filename = $half;
$newname = "$filename.jpg";
move_uploaded_file( $_FILES['fileField']['tmp_name'], "../user_upload/$newname");
and then here is the html:
Code:
div class="row_upload">
<div class="label">Upload Track(s)</div> <!-- end .label-->
<div class="input">
<input type="file" accept="application/zip,application/rar" name="fileField" id="fileField" value="test" />
</div> <!-- end .input -->
<div class="context">Upload your track(s) inside of a .ZIP or .RAR file ONLY</div><!-- end .context -->
</div> <!-- end .row -->
It won't work  if anyone can help me it would be greatly appreciated!!
|