找到
2
篇与
Upload
相关的结果
-
Code Up Ảnh Lên Imgur Bởi PMTpro Tính năng Tải ảnh từ máy hoặc import url lưu trữ tại imgur Lưu dữ liệu vào db để xem lại ảnh đã tải Xoá hiện thị ảnh đã tải Đăng nhập quản trị Tối ưu dung lượng chỉ 32.52 Kb Config tại system/config.php Demo PMTPRO图片 PMTPRO图片 PMTPRO图片 Tải xuống [button color="#FF0000" url="http://vietup.net/tap-tin/up-imgur-pmtpro-zip/293023"]Tải code[/button]
-
Upload File Bằng Curl Bài viết này sẽ hướng dẫn các bạn tạo một trang upload file đơn giản bằng CURL. Hướng dẫn Tạo và dán lần lượt 3 file dưới index.php <!DOCTYPE html> <html> <head> <title>File Upload Using PHP and cURL - freetuts.net</title> </head> <body> <form action="b.php" method="post" enctype="multipart/form-data"> <h3>Select File</h3> <input name="file" type="file" id="file" /> <hr /> <input name="btnUpload" type="submit" value="Upload" /> </form> </body> </html>curl.php <?php if (isset($_POST['btnUpload'])){ $filename = $_FILES['file']['name']; $filedata = $_FILES['file']['tmp_name']; $filesize = $_FILES['file']['size']; if ($filedata != ''){ $handle = fopen($filedata, 'rb'); $data = fread($handle, $filesize); fclose($handle); $postfields = array('filedata' => $data, 'filename' => $filename); $ch = curl_init('http://test.pro/upload.php'); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); if(curl_errno($ch)){ echo curl_error($ch); } else { $info = curl_getinfo($ch); if ($info['http_code'] == 200){ echo 'Upload thành công'; } } curl_close($ch); } else { echo 'Bạn chưa chọn file để upload'; } }upload.php <?php $uploadpath = 'upload/'; $filedata = $_POST['filedata']; $filename = $_POST['filename']; if ($filedata != '' && $filename != ''){ file_put_contents($uploadpath . $filename, $filedata); }Thay địa chỉ ở file curl.php và tạo thêm thư mục upload nữa là xong!