Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 29-11-2004, 03:43 PM
eina_227's Avatar
Novice Webmaster
 
Join Date: Nov 2004
Location: selangor
Posts: 11
Rep Power: 0
eina_227 is on a distinguished road
Arrow tulung..tulun.g...help PHP hustler

aii kawan2..nak tanya sikit..saya ade buat script untuk upload file dlm database..biase la limit size upload kan 2MB..bawah daripada tu saya leh upload..tapi...bile tgn saya gatal2 try upload file 3MB dia still kate my 'upload successfully' then the result appear kat table tapi without title and file size..only the discription appear.. ape sebenarnye yang dah berlaku... tolonglahhh
__________________
-ariana zellina-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 29-11-2004, 10:39 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 115
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
tolong?
BUT you don't even let us know a line of your code?! ....
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 30-11-2004, 08:41 AM
eina_227's Avatar
Novice Webmaster
 
Join Date: Nov 2004
Location: selangor
Posts: 11
Rep Power: 0
eina_227 is on a distinguished road
Cool sori..lupe...

<html>
<head>
<title>Title here!</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="2M">
Select a file to upload! <input type="file" name="userfile"><br>
<input type="submit" value="Upload!">
</form>
</body>
</html>
__________________
-ariana zellina-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 30-11-2004, 09:19 AM
Ben-davis's Avatar
Senior Webmaster
 
Join Date: Jan 2002
Location: SoObHanG JhaYa
Posts: 501
Rep Power: 91
Ben-davis is on a distinguished road
Send a message via ICQ to Ben-davis Send a message via Yahoo to Ben-davis
PHP code nye mana?
__________________
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" style="border:1px #393F31 solid;color:#393F31;font:10px Verdana;font-weight:bold;" >
<option value="0" style="background: #9CC8FE" selected>*SELECT-LINKS</option>
<option value="http://www.gengturbo.org/" style="background: #FF0000">GENGTURBO</option>
<option value="http://www.phixelgrafix.com/" target="new" style="background: #C6D607">PHIXELGRAFIX</option>
<option value="http://dailydigital.phixelgrafix.com/" style="background: #FCBC45">OLD-BLOG</option>
<option value="http://www.mesrahosting.net/" style="background: #FF99CC">WEBHOSTING</option>
</select>
</form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 30-11-2004, 09:30 AM
eina_227's Avatar
Novice Webmaster
 
Join Date: Nov 2004
Location: selangor
Posts: 11
Rep Power: 0
eina_227 is on a distinguished road
$record = array(); # Initialize an array to hold the record data to insert
$test=$_FILES['attachment']['size'];
if ($test > ($_POST['MAX_FILE_SIZE']))
{
$msg = _ADDFAILED . "<br>" . $dbconn->ErrorMsg();
}
else
{


// Set the values for the fields in the record


$filename = "$owner" . "_" . $_FILES['attachment']['name'];

$record[$column['attachment']['type']] = $_FILES['attachment']['type'];

$record[$column['attachment']['size']] = $_FILES['attachment']['size'];

if(move_uploaded_file($_FILES['attachment']['tmp_name'], $conf['path']['folder']['attachments'] . "/$module/$filename"))
{
$record[$column['attachment']['filename']] = $filename;
}
$record[$column['attachment']['module']] = $module;
$record[$column['attachment']['owner']] = $owner;
$record[$column['attachment']['desc']] = common::checkslashes($_REQUEST['desc']);
$record[$column['attachment']['keywords']] = common::checkslashes($_REQUEST['keywords']);
$record[$column['attachment']['cre_by']] = $_SESSION['sess_ref_id'];
$record[$column['attachment']['cre_time']] = time();
$record[$column['attachment']['upd_by']] = $_SESSION['sess_ref_id'];
$record[$column['attachment']['upd_time']] = time();

$sql = "SELECT * FROM " . $table['attachment'] . " WHERE " . $column['attachment']['id'] . " = -1";
// Select an empty record from the database

$rs = $dbconn->Execute($sql); // Execute the query and get the empty recordset

$insertSQL = $dbconn->GetInsertSQL($rs, $record); //generating insert statement

$result = $dbconn->Execute($insertSQL);
$msg = _ADDSUCCEED;

//common::AutoRedirect($delay,$goto,$code,$param,$ms g)
$param = "&c_code=$owner&category=$category";
if(isset($_REQUEST['ispopup']) && $_REQUEST['ispopup'] == "1")
$param .= "&ispopup=1";
common::AutoRedirect(1,common::PrepUrl("goto.php") ,"contact_attachment","$param","$msg");
__________________
-ariana zellina-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 30-11-2004, 09:36 AM
eina_227's Avatar
Novice Webmaster
 
Join Date: Nov 2004
Location: selangor
Posts: 11
Rep Power: 0
eina_227 is on a distinguished road
html code

<form name="add" method="post" action="{$action_file}" onsubmit="return ValidateForm()" ENCTYPE="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<table cellspacing="0" cellpadding="6" width="100%" border="1" bordercolor="#FFFFFF" align="center" bgcolor="#E4EAF2">

{PrintMFileField label=$smarty.const._ATTACHMENT name="attachment" size="30"}

{PrintTxtField label=$smarty.const._DESC name="desc" size="30" maxlength="50"}

{PrintTextAreaField label=$smarty.const._KEYWORDS name="keywords" cols="60" rows="6"}

<tr class="formheader">
<td colspan="2" align="center">
<br>
<button class="button" onClick="javascript:window.opener.location.href = window.opener.location.href;window.close();">Cance l</button>&nbsp;&nbsp;
<input class="button" type="submit" name="upload" value="Upload" onClick="this.form.action.value='attach';">
{if $smarty.request.ispopup == "1"}
<button class="button" onClick="javascript:window.opener.location.href = window.opener.location.href;window.close();">Done</button>
{else}
<input class="button" type="submit" name="upload" value="Done" onClick="this.form.action.value='done';">
{/if}
<br><br>
<font class="bodytext">Note: Maximum filesize is 2Mb</font>
</td></tr>

</table>
__________________
-ariana zellina-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 30-11-2004, 12:49 PM
eina_227's Avatar
Novice Webmaster
 
Join Date: Nov 2004
Location: selangor
Posts: 11
Rep Power: 0
eina_227 is on a distinguished road
saya dah dapat solution pasal upload tapi kenapa bile saya nak upload file yg bersaiz lebih dari 8MB ke atas, tak de warning keluar..dia cume refresh page saya jerk..utk 7MB ke bawah ok.. nape ek rakan2 sekalian....
__________________
-ariana zellina-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 30-11-2004, 03:40 PM
heterozigot's Avatar
Novice Webmaster
 
Join Date: Jan 2003
Location: PJ
Posts: 51
Rep Power: 70
heterozigot is on a distinguished road
Send a message via ICQ to heterozigot Send a message via Yahoo to heterozigot
Ko gi kat php.ini file

ko edit ni:

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

letak berapa MB ko mau...cuba
__________________
Try and Support Malaysia Product.
http://foto.home.net.my
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-12-2004, 02:16 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 115
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
Like what heterozigot said, it may caused by the upload limit setting in your webserver.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-12-2004, 08:51 AM
eina_227's Avatar
Novice Webmaster
 
Join Date: Nov 2004
Location: selangor
Posts: 11
Rep Power: 0
eina_227 is on a distinguished road
wokey..thanks alot aaaaa.....its work
__________________
-ariana zellina-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tulun Aku.. Camner nak wat user login kat ASPX aaa thorax_101 Website Design 3 09-07-2005 10:10 PM
Calling all php hustler. koisempoi Website Programming 21 03-12-2003 07:27 PM



All times are GMT +8. The time now is 02:10 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59