upload

Upload file in Android with outofmemory error

别等时光非礼了梦想. 提交于 2019-12-02 10:02:30
My upload code as below: String end = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; try { URL url = new URL(ActionUrl); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setRequestMethod("POST"); con.setRequestProperty("Connection", "Keep-Alive"); con.setRequestProperty("Accept", "text/*"); con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); DataOutputStream ds = new DataOutputStream(con.getOutputStream()); ds.writeBytes(twoHyphens + boundary + end); ds

php trying to upload file: “No Such file or directory”

若如初见. 提交于 2019-12-02 09:58:49
I want to upload a file into an existing folder, /media/images/avatars/ , but receive the following error: No such file or directory . What am I doing wrong? I'm using Ubuntu, if that matters. Here is my code: if (!empty($_FILES['file']['name'])) { $allowedExts = array("jpg", "jpeg", "gif", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 64000) && in_array($extension,

Loading data issues

大兔子大兔子 提交于 2019-12-02 09:26:35
Datalink: Data Code: ccfsisims <- read.csv(file = "F:/Purdue University/RA_Position/PhD_ResearchandDissert/PhD_Draft/GTAP-CGE/GTAP_NewAggDatabase/NewFiles/GTAP_ConsIndex.csv", header=TRUE, sep=",", na.string="NA", dec=".", strip.white=TRUE) ccfsirsts <- as.data.frame(ccfsisims) ccfsirsts[7:25] <- sapply(ccfsirsts[7:25],as.numeric) ccfsirsts <- droplevels(ccfsirsts) ccfsirsts <- transform(ccfsirsts,sres=factor(sres,levels=unique(sres))) ccfsirsts[1:5,] Issue: So, if you check the column "pSVIPM", the values displayed in the dataframe "ccfsirsts" are different from what is actually saved in the

How to insert and move multiple image using codeigniter?

岁酱吖の 提交于 2019-12-02 09:23:51
view: <script> $(document).ready(function(){ $("#submit").click(function(e){ e.preventDefault(); product_name = $("#product_name").val(); color = $("#colorWell").val(); $.ajax({ type:"POST", data:{"product_name":product_name, "color":color}, url:"<?php echo base_url(); ?>admin/products", success:function(data){ alert(data); } }); }); }); </script> <input type="text" class="form-control" id="product_name" name="product_name"> <input type="color" id="colorWell" name="color"> <input type="file" id="product_image" name="product_image[]" multiple> <input type="submit" class="btn btn-primary" id=

upload a file using FTP and php

淺唱寂寞╮ 提交于 2019-12-02 09:20:20
I can't Upload the file using php because i can't send the path i got from the html file to the function FTP_PUT because it only takes string "test.txt" How Can i send the Path to this function PHP FILE $file = $_POST["file"]; // upload file if (ftp_put($ftp_conn, $file, $file, FTP_BINARY)) { echo "Successfully uploaded $file."; } else { echo "Error uploading $file."; } // close connection ftp_close($ftp_conn); HTML FILE <div class="container"> <div class="row"> <div class="col-lg-12"> <form class="well" action="Upload.php" method="post" > <div class="form-group"> <label for="file">Select a

Why is the bitmapdata not posted to server side with flash?

前提是你 提交于 2019-12-02 09:12:53
Here is the code I used to post the bitmapdata to server side( PHP ): private function savePicToServer(bmpData:BitmapData):void { trace("in savePicToServer"); trace(bmpData); var jpgEncoder:JPGEncoder = new JPGEncoder(85); var jpgStream:ByteArray = jpgEncoder.encode(bmpData); var loader:URLLoader = new URLLoader(); var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream"); var request:URLRequest = new URLRequest("http://localhost/test.php"); request.requestHeaders.push(header); request.method = URLRequestMethod.POST; request.data = jpgStream; loader.load

cordova: upload image not working after taking picture

余生颓废 提交于 2019-12-02 09:10:10
Iam working on a iOS App developed with Apache Cordova aka Phonegap. I'd like to upload photos in two steps: 1. Capture the photo and show the photo in small size 2. Upload the photo I need one button for taking the picture and one button to upload. My script doesn't work. Whats wrong? Here is my JavaScript file: var pictureSource; var destinationType; document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { pictureSource = navigator.camera.PictureSourceType; destinationType = navigator.camera.DestinationType; } function clearCache() { navigator.camera.cleanup

Simple PHP/HTML upload page - no files are saving

牧云@^-^@ 提交于 2019-12-02 09:07:50
I'm new to HTML/PHP and I'm trying to create a simple php file upload page. I have this as my HTML <!DOCTYPE html> <html> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> </body> </html> I have this as my php: <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual

multi step form with upload & save to node type

倾然丶 夕夏残阳落幕 提交于 2019-12-02 08:36:41
im trying about a week to do multistep form usin form api in drupal 6 and in the step 2 there is 2 upload fields and then its should proceed until step 5, after user fill the step 1 he can skip the whole form and submit the data... im trying to do it and im not success, i glue some pices of code and its not work , and multiform plugin is kinda buggy anyone did something like that and can share the code or just explain me what functions i should use and how? Try multiform, but be careful as it is still in dev state. If you want to do it on your own, have a storage variable called step in the

How to upload image and save path to database?

坚强是说给别人听的谎言 提交于 2019-12-02 07:52:31
I have a page where some images are shown (database driven). Here is the code of my gallery.php : <ul id="portfolio-list" class="gallery"> <?php $sql="select * from eikones "; $res=mysql_query($sql); $count=mysql_num_rows($res); for ( $i = 0; $i < $count; ++$i ) { $row = mysql_fetch_array( $res ); $co=$i+1; if(isset($row[ "path" ])) { $path= $row[ "path" ]; } if(isset($row[ "auxon" ])) { $auxon = $row[ "auxon" ]; } if($_SESSION['role'] == "admin") echo "<li class=\"pink\"><a href=\"$path\" rel=\"group1\" class=\"fancybox\" title=\"Προιόν \"><img src=\"$path\" alt=\"Pic\"></a></li>\n"; } ?> <