future_funk Posted November 22, 2004 Report Share Posted November 22, 2004 Vajag nosleept parasto peec nokluseejuma BROWSE pogu un izveidot savu... <form name='forma' action='upload.php' method='post' ENCTYPE='multipart/form-data'> <input type='file' name='file' style='display:none;'> <input type='text' name='browse'> <img src='btn_browse.gif' onClick='document.forma.file.click();document.forma.browse.value=document.forma.file.value;document.forma.file.disabled=true;'> <input type='image' src='btn_ok.gif' name='submit'> </form> Princips: 1.tiek nosleepts type=file 2.klikskinot uz img src='btn_browse.gif' tiek izsaukts type='file' BROWSE logs, kur izveelamies failu 3.izveeletais fails tiek atteelots type='text' lodzinaa 4.spiezam type='image' (SUBMIT) Probleema: peec idejas skriptam 'upload.php' tiek nodoti formas dati, bet reaali tas nenotiek, kaapeec? Link to comment Share on other sites More sharing options...
рпр Posted November 22, 2004 Report Share Posted November 22, 2004 iespeejams deelj shii, jo disableetos laukus browzeris nekur nesuuta. document.forma.file.disabled=true; Link to comment Share on other sites More sharing options...
Venom Posted November 22, 2004 Report Share Posted November 22, 2004 laikam nevarēs, cik sapratu, jo browseris neļauj uploadēt no inputa kurā tika vienkārši ierakstīts faila nosaukums, jo tad varētu taisīt slēptos freimus, kur būtu <input type="file" value="c:/secret.file" /> un taisīt form.submit() ar javascriptu Link to comment Share on other sites More sharing options...
Recommended Posts