Jump to content
Cho Chang

Upload File With Php

Recommended Posts

aku nie tak de la pandai sgt

aku budak baru belajar gak

tapi aku edit dari script nie

http://www.americanfinancing.net/downloads...upload-form.zip

ko download file nie ade form dan script php sekali

mungkin dpt membantu

ari tuh aku buat web form aku dari script file nie la

cuma ade benda ko kene ubah sikit-sikit

try ar tgk dulu cam ner membantu ke tak

Share this post


Link to post
Share on other sites

......

thanks brooo.... aku nya script aku dah run dhh... hmmm tp msalah nya bla aku save file aku nie ke pc extension dia x dpt.... file name tu leh ada white space x????

p/s: aku ska coding dr scratch ^_^

Edited by Cho Chang

Share this post


Link to post
Share on other sites

file apo yg ko save plak ni?

file yg ko upload & ko buat download plak? penerangan tak berapa jelas la...

white space takpe tp kena ada tanda buka ->' & tutup -> '

baru leh baca walau ada white space

Share this post


Link to post
Share on other sites

file apo yg ko save plak ni?

file yg ko upload & ko buat download plak? penerangan tak berapa jelas la...

white space takpe tp kena ada tanda buka ->' & tutup -> '

baru leh baca walau ada white space

file yg aku upload tu laaa... aku wat donload skali... hmmm msalhnya bla aku upload file yang x da white space ok ja time aku donload....extension sume ada... tp klu ada white space x dpt plak.... contoh fail aku nama "Fail saya.doc" bla download to pc dpt "Fail" jaa.... huhuhuhuh aku wat pkai trim x leh pownnn napa ehhh

Share this post


Link to post
Share on other sites

paste code download ko kat sini

biasanya dia camni jer

<a href='$namafile'>Download</a>

pastikan ada tanda -> ''

hmmm jd aku kena alter aku nya page donload la.... aku wat lebih kurang camtu jgk... sb dlm db aku aku taruk 1 column file_name.... jd aku link ke db tok amik value kat column tuhhh.... tp x dpt jgkkk... aku rs msti sb white space nihhh.... :wacko:

Share this post


Link to post
Share on other sites

just paste code ko kat sini..jgn salahkan white space plak sian dia

<a href="download.php?kod=<?=$rowv['Kod'];?>">Lihat Fail </a>
nie kod kat download page
<?
include 'inc/conn.php';
if(isset($_GET['kod']))
{

......db connect script

header("Content-Disposition: attachment; filename=$name");
header("Content-length: $size");
header("Content-type: $type");

readfile($filePath);
exit;
}
?>

Edited by Cho Chang

Share this post


Link to post
Share on other sites

code ni ke nama file tu??

yuppp.... aku sent header jaaa... BTW dh ok dhhh... mmg bkn sb white space.... sbbb aku test gna FF yg bru x bleh.... tp ie 6 ok jeee.... thanks broooo..... solution dia aku buang w.space hehehe both ie 6,7 and FF can download fail tu...

p/s: bro dok mn??? meh jitra gtau aku kk.... aku blanja mkn.... serious nihhh..... :lol:

Share this post


Link to post
Share on other sites

solution=buang white space?

tak praktikal sgt.sbg cth kalo user yg upload file xkan dia nak rename file dulu kan

btw dlm senario ko aku tak tau la plak

maybe code ko kena camni

header("Content-Disposition: attachment; filename='$name' ");

biasakan menggunakan <?php daripada <?

sebabnya default setting php versi terbaru takleh baca tanda <?

aku dok kelate la jauh sgt nak g mkn kat jitra tu kekek

Edited by ejoe

Share this post


Link to post
Share on other sites

solution=buang white space?

tak praktikal sgt.sbg cth kalo user yg upload file xkan dia nak rename file dulu kan

btw dlm senario ko aku tak tau la plak

x la user yang buang w.space tuu... tp aku ngah usha2 trim function.... hmmmm... aku cm nak rapatkan ja nama file tuuu cnth "fail saya.txt" --> "failsaya.txt" atau --> "fail_saya.txt"

biasakan menggunakan <?php daripada <?

sebabnya default setting php versi terbaru takleh baca tanda <?

aku dok kelate la jauh sgt nak g mkn kat jitra tu kekek

yupp btol tuhhh aku pown tngah tukar.... thank for the infooo....

p/s ala ble2 ko mai cnie PM la aku aku g jmput ko+blanja ko mkn hhehehehe :lol:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...