Search Results

Search found 4900 results on 196 pages for 'upload'.

Page 18/196 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • plupload not working in wordpress theme files

    - by Kedar B
    This is my code for image upload.... <a id="aaiu-uploader" class="aaiu_button" href="#"><?php _e('*Select Images (mandatory)','wpestate');?></a> <input type="hidden" name="attachid" id="attachid" value="<?php echo $attachid;?>"> <input type="hidden" name="attachthumb" id="attachthumb" value="<? php echo $thumbid;?>"> i want upload functionality more than one time in single page in wordpress.i have add js code for that same as first upload block but its not working. This is js code for image upload.... jQuery(document).ready(function($) { "use strict"; if (typeof(plupload) !== 'undefined') { var uploader = new plupload.Uploader(ajax_vars.plupload); uploader.init(); uploader.bind('FilesAdded', function (up, files) { $.each(files, function (i, file) { // console.log('append'+file.id ); $('#aaiu-upload-imagelist').append( '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b>' + '</div>'); }); up.refresh(); // Reposition Flash/Silverlight uploader.start(); }); uploader.bind('UploadProgress', function (up, file) { $('#' + file.id + " b").html(file.percent + "%"); }); // On erro occur uploader.bind('Error', function (up, err) { $('#aaiu-upload-imagelist').append("<div>Error: " + err.code + ", Message: " + err.message + (err.file ? ", File: " + err.file.name : "") + "</div>" ); up.refresh(); // Reposition Flash/Silverlight }); uploader.bind('FileUploaded', function (up, file, response) { var result = $.parseJSON(response.response); // console.log(result); $('#' + file.id).remove(); if (result.success) { $('#profile-image').css('background-image','url("'+result.html+'")'); $('#profile-image').attr('data-profileurl',result.html); $('#profile-image_id').val(result.attach); var all_id=$('#attachid').val(); all_id=all_id+","+result.attach; $('#attachid').val(all_id); $('#imagelist').append('<div class="uploaded_images" data- imageid="'+result.attach+'"><img src="'+result.html+'" alt="thumb" /><i class="fa deleter fa-trash-o"></i> </div>'); delete_binder(); thumb_setter(); } }); $('#aaiu-uploader').click(function (e) { uploader.start(); e.preventDefault(); }); $('#aaiu-uploader2').click(function (e) { uploader.start(); e.preventDefault(); }); } });

    Read the article

  • android upload progressbarr not working

    - by pieter
    I'm a beginner in Android programming and I was tryinh to upload an image to a server. I found some code here on stackoverflow, I adjusted it and it still doesn't work. The problem is my image still won't upload. edit I solved the problem, I had no rights on the folder on the server. Now I have a new problem. the progresbarr doesn't work. it keeps saying 0 % transmitted does anyone sees an error in my code? import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.Window; import android.widget.Button; import android.widget.ImageView; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; public class PreviewActivity extends Activity { /** The captured image file. Get it's path from the starting intent */ private File mImage; public static final String EXTRA_IMAGE_PATH = "extraImagePath" /** Log tag */ private static final String TAG = "DFH"; /** Progress dialog id */ private static final int UPLOAD_PROGRESS_DIALOG = 0; private static final int UPLOAD_ERROR_DIALOG = 1; private static final int UPLOAD_SUCCESS_DIALOG = 2; /** Handler to confirm button */ private Button mConfirm; /** Handler to cancel button */ private Button mCancel; /** Uploading progress dialog */ private ProgressDialog mDialog; /** * Called when the activity is created * * We load the captured image, and register button callbacks */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.preview); setResult(RESULT_CANCELED); // Import image Bundle extras = getIntent().getExtras(); String imagePath = extras.getString(FotoActivity.EXTRA_IMAGE_PATH); Log.d("DFHprev", imagePath); mImage = new File(imagePath); if (mImage.exists()) { setResult(RESULT_OK); loadImage(mImage); } registerButtonCallbacks(); } @Override protected void onPause() { super.onPause(); } /** * Register callbacks for ui buttons */ protected void registerButtonCallbacks() { // Cancel button callback mCancel = (Button) findViewById(R.id.preview_send_cancel); mCancel.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { PreviewActivity.this.finish(); } }); // Confirm button callback mConfirm = (Button) findViewById(R.id.preview_send_confirm); mConfirm.setEnabled(true); mConfirm.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { new UploadImageTask().execute(mImage); } }); } /** * Initialize the dialogs */ @Override protected Dialog onCreateDialog(int id) { switch(id) { case UPLOAD_PROGRESS_DIALOG: mDialog = new ProgressDialog(this); mDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); mDialog.setCancelable(false); mDialog.setTitle(getString(R.string.progress_dialog_title_connecting)); return mDialog; case UPLOAD_ERROR_DIALOG: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.upload_error_title) .setIcon(android.R.drawable.ic_dialog_alert) .setMessage(R.string.upload_error_message) .setCancelable(false) .setPositiveButton(getString(R.string.retry), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { PreviewActivity.this.finish(); } }); return builder.create(); case UPLOAD_SUCCESS_DIALOG: AlertDialog.Builder success = new AlertDialog.Builder(this); success.setTitle(R.string.upload_success_title) .setIcon(android.R.drawable.ic_dialog_info) .setMessage(R.string.upload_success_message) .setCancelable(false) .setPositiveButton(getString(R.string.success), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { PreviewActivity.this.finish(); } }); return success.create(); default: return null; } } /** * Prepare the progress dialog */ @Override protected void onPrepareDialog(int id, Dialog dialog) { switch(id) { case UPLOAD_PROGRESS_DIALOG: mDialog.setProgress(0); mDialog.setTitle(getString(R.string.progress_dialog_title_connecting)); } } /** * Load the image file into the imageView * * @param image */ protected void loadImage(File image) { Bitmap bm = BitmapFactory.decodeFile(image.getPath()); ImageView view = (ImageView) findViewById(R.id.preview_image); view.setImageBitmap(bm); } /** * Asynchronous task to upload file to server */ class UploadImageTask extends AsyncTask<File, Integer, Boolean> { /** Upload file to this url */ private static final String UPLOAD_URL = "http://www.xxxx.x/xxxx/fotos"; /** Send the file with this form name */ private static final String FIELD_FILE = "file"; /** * Prepare activity before upload */ @Override protected void onPreExecute() { super.onPreExecute(); setProgressBarIndeterminateVisibility(true); mConfirm.setEnabled(false); mCancel.setEnabled(false); showDialog(UPLOAD_PROGRESS_DIALOG); } /** * Clean app state after upload is completed */ @Override protected void onPostExecute(Boolean result) { super.onPostExecute(result); setProgressBarIndeterminateVisibility(false); mConfirm.setEnabled(true); mDialog.dismiss(); if (result) { showDialog(UPLOAD_SUCCESS_DIALOG); } else { showDialog(UPLOAD_ERROR_DIALOG); } } @Override protected Boolean doInBackground(File... image) { return doFileUpload(image[0], "UPLOAD_URL"); } @Override protected void onProgressUpdate(Integer... values) { super.onProgressUpdate(values); if (values[0] == 0) { mDialog.setTitle(getString(R.string.progress_dialog_title_uploading)); } mDialog.setProgress(values[0]); } private boolean doFileUpload(File file, String uploadUrl) { HttpURLConnection connection = null; DataOutputStream outputStream = null; DataInputStream inputStream = null; String pathToOurFile = file.getPath(); String urlServer = "http://www.xxxx.x/xxxx/upload.php"; String lineEnd = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; // log pathtoourfile Log.d("DFHinUpl", pathToOurFile); int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; int sentBytes = 0; long fileSize = file.length(); // log filesize String files= String.valueOf(fileSize); String buffers= String.valueOf(maxBufferSize); Log.d("fotosize",files); Log.d("buffers",buffers); try { FileInputStream fileInputStream = new FileInputStream(new File(pathToOurFile) ); URL url = new URL(urlServer); connection = (HttpURLConnection) url.openConnection(); // Allow Inputs & Outputs connection.setDoInput(true); connection.setDoOutput(true); connection.setUseCaches(false); // Enable POST method connection.setRequestMethod("POST"); connection.setRequestProperty("Connection", "Keep-Alive"); connection.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary); outputStream = new DataOutputStream( connection.getOutputStream() ); outputStream.writeBytes(twoHyphens + boundary + lineEnd); outputStream.writeBytes("Content-Disposition: form-data; name=\"uploadedfile\";filename=\"" + pathToOurFile +"\"" + lineEnd); outputStream.writeBytes(lineEnd); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); buffer = new byte[bufferSize]; // Read file bytesRead = fileInputStream.read(buffer, 0, bufferSize); while (bytesRead > 0) { outputStream.write(buffer, 0, bufferSize); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); bytesRead = fileInputStream.read(buffer, 0, bufferSize); sentBytes += bufferSize; publishProgress((int)(sentBytes * 100 / fileSize)); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); bytesRead = fileInputStream.read(buffer, 0, bufferSize); } outputStream.writeBytes(lineEnd); outputStream.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); // Responses from the server (code and message) int serverResponseCode = connection.getResponseCode(); String serverResponseMessage = connection.getResponseMessage(); fileInputStream.close(); outputStream.flush(); outputStream.close(); try { int responseCode = connection.getResponseCode(); return responseCode == 200; } catch (IOException ioex) { Log.e("DFHUPLOAD", "Upload file failed: " + ioex.getMessage(), ioex); return false; } catch (Exception e) { Log.e("DFHUPLOAD", "Upload file failed: " + e.getMessage(), e); return false; } } catch (Exception ex) { String msg= ex.getMessage(); Log.d("DFHUPLOAD", msg); } return true; } } } the PHP code that handles this upload is following: <?php $date=getdate(); $urldate=$date['year'].$date['month'].$date['month'].$date['hours'].$date['minutes'].$date[ 'seconds']; $target_path = "./"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']) . $urldate; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> would really appreciate it if someone could help me.

    Read the article

  • JavaFX: File upload to REST service / servlet fails because of missing boundary

    - by spa
    I'm trying to upload a file using JavaFX using the HttpRequest. For this purpose I have written the following function. function uploadFile(inputFile : File) : Void { // check file if (inputFile == null or not(inputFile.exists()) or inputFile.isDirectory()) { return; } def httpRequest : HttpRequest = HttpRequest { location: urlConverter.encodeURL("{serverUrl}"); source: new FileInputStream(inputFile) method: HttpRequest.POST headers: [ HttpHeader { name: HttpHeader.CONTENT_TYPE value: "multipart/form-data" } ] } httpRequest.start(); } On the server side, I am trying to handle the incoming data using the Apache Commons FileUpload API using a Jersey REST service. The code used to do this is a simple copy of the FileUpload tutorial on the Apache homepage. @Path("Upload") public class UploadService { public static final String RC_OK = "OK"; public static final String RC_ERROR = "ERROR"; @POST @Produces("text/plain") public String handleFileUpload(@Context HttpServletRequest request) { if (!ServletFileUpload.isMultipartContent(request)) { return RC_ERROR; } FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List<FileItem> items = null; try { items = upload.parseRequest(request); } catch (FileUploadException e) { e.printStackTrace(); return RC_ERROR; } ... } } However, I get a exception at items = upload.parseRequest(request);: org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found I guess I have to add a manual boundary info to the InputStream. Is there any easy solution to do this? Or are there even other solutions?

    Read the article

  • Accents in uploaded file being replaced with '?'

    - by Katfish
    I am building a data import tool for the admin section of a website I am working on. The data is in both French and English, and contains many accented characters. Whenever I attempt to upload a file, parse the data, and store it in my MySQL database, the accents are replaced with '?'. I have text files containing data (charset is iso-8859-1) which I upload to my server using CodeIgniter's file upload library. I then read the file in PHP. My code is similar to this: $this->upload->do_upload() $data = array('upload_data' => $this->upload->data()); $fileHandle = fopen($data['upload_data']['full_path'], "r"); while (($line = fgets($fileHandle)) !== false) { echo $line; } This produces lines with accents replaced with '?'. Everything else is correct. If I download my uploaded file from my server over FTP, the charset is still iso-8850-1, but a diff reveals that the file has changed. However, if I open the file in TextEdit, it displays properly. I attempted to use PHP's stream_encoding method to explicitly set my file stream to iso-8859-1, but my build of PHP does not have the method. After running out of ideas, I tried wrapping my strings in both utf8_encode and utf8_decode. Neither worked. If anyone has any suggestions about things I could try, I would be extremely grateful.

    Read the article

  • What exactly does it mean when $_FILES is empty?

    - by Mike
    I am working on an upload script and when testing my error checks, I attempted to upload a 17MB TIFF file. When I do this the $_FILES array is empty. The script works fine for what I need it to do, which is to upload JPEG files. My solution is to test if $_FILES is empty or not before continuing with the upload script. Can anybody explain why $_FILES is empty when a TIFF is attempted to be uploaded? Is my solution, to check if $_FILES is empty or not, an okay one?

    Read the article

  • How to test if a user has uploaded a file ?

    - by Tristan
    Hello, on a page, i have : if (!empty($_FILES['logo']['name'])) { $dossier = 'upload/'; $fichier = basename($_FILES['logo']['name']); $taille_maxi = 100000; $taille = filesize($_FILES['logo']['tmp_name']); $extensions = array('.png', '.jpg', '.jpeg'); $extension = strrchr($_FILES['logo']['name'], '.'); //Début des vérifications de sécurité... if(!in_array($extension, $extensions)) { $erreur = 'ERROR you must upload the right type'; } if($taille>$taille_maxi) { $erreur = 'too heavy'; } if(!empty($erreur)) { ....................... } The problem is, if the users wants to edit information WITHOUT uploading a LOGO, it raises an error : 'error you must upload the right type' So, if a user didn't put anything in the inputbox in order to upload it, i don't want to enter in these conditions test. i tested : if (!empty($_FILES['logo']['name']) and if (isset($_FILES['logo']['name']) but both doesn't seems to work. Any ideas? thanks.

    Read the article

  • delete function and upload

    - by Jesper Petersen
    it must be said that I download the database and all my function is in class. That's how I was incredible pleased function and think they are nice .. That's how I'm going to build a gallery where the id of the upload to the site if it fits with the id_session is log in page, you have the option to delete it. and so it must just go back to / latest pictures / when it delete it from the folder and database. but it comes up with an error as you can see here; Fatal error: Call to a member function bind_param () on a non-object in / home / jesperbo / public_html / mebe.dk / function / function.php on line 411 It is such that I am also in the process of building an upload system where the underlying database and make it smaller after what I have now set it and when it did the 2 things must send me back to / latest-images / but it do not reach the only available picture up on the server and do it with the picture but it will not go back in some way at all. So to / latest-images / Where wrong with it to delete, etc. I lie just here, $stm1->bind_param('i', $id_gallery); function img_slet_indhold(){ if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2) { if($stmt = $this->mysqli->prepare('SELECT `title` FROM `gallery` WHERE `id_gallery` = ?')) { $stm1->bind_param('i', $id_gallery); $id_gallery = $_GET["id_gallery"]; $stm1->execute(); $stm1->store_result(); $stm1->bind_result($title); $UploadDir = "/gallery/"; //ligger i toppen af documentet, evt som en define if($stm1->fetch()) { $tmpfile = $UploadDir . "" . $title; if(file_exists($tmpfile)) { unlink($tmpfile); } $tmpfile = $UploadDir . "lille/" . $title; if(file_exists($tmpfile)) { unlink($tmpfile); } $tmpfile = $UploadDir . "store/" . $title; if(file_exists($tmpfile)) { unlink($tmpfile); } } $stm1->close(); } else { /* Der er opstået en fejl */ echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error; } } if($stmt = $this->mysqli->prepare('DELETE FROM `gallery` WHERE `id_gallery` = ?' )) { $stmt->bind_param('i', $id); $id = $_GET["id_gallery"]; $stmt->execute(); header('Location: /nyeste-billeder/'); $stmt->close(); } else { /* Der er opstået en fejl */ echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error; } } So into the file as it should delete from, I have chosen to do so here; <?php session_start(); require_once ("function/function.php"); $mebe = new mebe; $db = $mebe->db_c(); error_reporting(E_ERROR); $img_slet_indhold = $mebe->img_slet_indhold(); ?> So when I upload image to folder and database, and just after can be returned when uploading function img_indhold(){ if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2) { include "function/class.upload.php"; $handle = new Upload($_FILES["filename"]); if($handle->uploaded) { //lidt mere store billeder $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 220; $handle->Process("gallery/store"); //til profil billede lign.. $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->image_y = 115; $handle->image_x = 100; $handle->Process("gallery"); //til profil billede lign.. $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->image_y = 75; $handle->image_x = 75; $handle->Process("gallery/lille"); $pb = $handle->file_dst_name; } if($stmt = $this->mysqli->prepare('INSERT INTO `gallery` (`title`, `id_bruger`) VALUES (?, ?)')) { $stmt->bind_param('si', $title, $id_bruger); $title = $pb; $id_bruger = $_SESSION["id"]; $stmt->execute(); header('Location: /nyeste-billeder/'); $stmt->close(); } } } So when I call it on the page when it is required to do so do it like this; <?php session_start(); require_once ("function/function.php"); $mebe = new mebe; $db = $mebe->db_c(); error_reporting(E_ERROR); $img_slet_indhold = $mebe->img_slet_indhold(); ?> it is here as to when I will upload to the site and show gallery / pictures on the page function vise_img(){ if ($stmt = $this->mysqli->prepare('SELECT `id_gallery`, `title`, `id_bruger` FROM `gallery` ORDER BY `gallery`.`id_gallery` DESC')) { $stmt->execute(); $stmt->store_result(); $stmt->bind_result($id_gallery, $title, $id_bruger); while ($stmt->fetch()) { echo "<div id=\"gallery_box\">"; echo "<a href=\"/profil/$id_bruger/\"><img src=\"/gallery/$title\" alt=\"\" height=\"115\" width=\"100\" border=\"0\"></a>"; if($_SESSION["logged_in"]) { if($id_bruger == $_SESSION["id"]) { echo "<ul>"; echo "<li><a href=\"/nyeste-billeder-slet/$id_gallery/\">Slet</a></li>"; echo "</ul>"; } } echo "</div>"; } /* Luk statement */ $stmt->close(); } else { /* Der er opstået en fejl */ echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error; } } function upload_img(){ if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2) { ?> <form name="opslag" method="post" action="/nyeste-ok/" enctype="multipart/form-data"> <input type="file" name="filename" id="filename" onchange="checkFileExt(this)"> <input name="upload" value="Upload" id="background_indhold" onclick="return check()" type="submit"> </form> <?php } elseif ($_SESSION["logged_in"] != true && $_SESSION["rank"] != '1' || $_SESSION["rank"] != 2) { echo "<p>Du har ingen mulighed for at upload billeder på siden</p>"; } } Really hope you are able to help me further!

    Read the article

  • retrieved upload images in php

    - by hunter
    i want to retrieve image from client (ipod) programmed in objective c i use the following code $TARGET_PATH = "pics/"; $image = $_FILES['photo']; $TARGET_PATH =$TARGET_PATH . basename( $_FILES['photo']['name']); $TARGET_PATH =$TARGET_PATH.".jpg"; if(file_exists($TARGET_PATH)) { $TARGET_PATH =$TARGET_PATH .uniqid() . ".jpg"; } if (move_uploaded_file($image['tmp_name'], $TARGET_PATH)) { $TARGET_PATH="http://www.".$_SERVER["SERVER_NAME"]."/abc/".$TARGET_PATH; echo $TARGET_PATH; echo "image upload successfully";} else{ echo "could not upload image"; } this code upload five to six images successfully and after that it gives me error i.e Notice: Undefined index: photo in /home/abc/public_html/abc.com/fish/mycatch_post.php on line 42 Notice: Undefined index: photo in /home/abc/public_html/abc.com/fish/mycatch_post.php on line 53 could not upload image

    Read the article

  • uploading images with the help of arrays and fetch errors

    - by bonny
    i use a script to upload a couple of images to a directory. the code works great in case of just one picture will be uploaded. if i like to upload two images or more and have an extension that is not accepted, the script will upload the one with the extension that is allowed to upload and shows the errormessage for the one who is not accepted. but the upload takes place. that's my first problem. second problem will be: in case of an errormessage i would like to display a message in which it is said, which of the images will be not allowed. i do not know how to fetch this one that has an unaccepted ending into a variable that i can echo to the errormessage. here is the code i use: if(!empty($_FILES['image']['tmp_name'])){ $allowed_extension = array('jpg', 'jpeg', 'png', 'bmp', 'tiff', 'gif'); foreach($_FILES['image']['name'] as $key => $array_value){ $file_name = $_FILES['image']['name'][$key]; $file_size = $_FILES['image']['size'][$key]; $file_tmp = $_FILES['image']['tmp_name'][$key]; $file_extension = strtolower(end(explode('.', $file_name))); if (in_array($file_extension, $allowed_extension) === false){ $errors[] = 'its an unaccepted format in picture $variable_that_count'; continue; } if ($file_size > 2097152){ $errors[] = 'reached maxsize of 2MB per file in picture $variable_that_count'; } if (count($errors) == 0){ $path = "a/b/c/"; $uploadfile = $path."/".basename($_FILES['image']['name'][$key]); if (move_uploaded_file($_FILES['image']['tmp_name'][$key], $uploadfile)){ echo "success."; } } } } hope it will be clear what i like to approach. if there is someone who could help out i really would appreciate. thanks a lot.

    Read the article

  • Tunnel Failed at the time of Upload file to FTP

    - by Karthick
    File upload is works fine from my simulator (blackberry 8830).It upload the file to FTP Server. But in the device when I try to upload file to FTP server it gives the alert “Tunnel Failed “. I am using StreamConnection sc = (StreamConnection) Connector.open(url); How to solve this issue. Can anyone help me???

    Read the article

  • Retrieving Data From formData in Rails jquery-file-upload

    - by CanCeylan
    I am trying to add additional form data by using https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-form-data this tutorial for jQuery-File-Upload plugin in my Rails app. I'm following the instructions for Setting formData on upload start for each individual file upload. My problem is, after saving the files with their titles as explained in tutorial, I cannot show them in the final table, because I don't know how to reach the formData's values. How should I reach the data inside data.formData = inputs.serializeArray(); and post them next to each item ? Thanks.

    Read the article

  • php,codigniter, upload the zip file problem

    - by user345804
    function upload( &$data = array() ) { $config['upload_path'] = 'system/application/orginalimage/'; $config['allowed_types'] = 'gif|jpg|png|zip'; $config['allowed_type'] = 'application/zip'; $config['allowed_type'] = 'application/x-zip-compressed'; $config['allowed_type'] = 'application/x-compress'; $config['allowed_type'] = 'application/x-compressed'; $config['allowed_type'] = 'application/octet-stream'; $config['allowed_type'] = 'multipart/x-zip'; $config['max_size'] = '100'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->load->library('upload', $config); if ( $this->upload->do_upload( 'uploadimage')) { $data = $this->upload->data() ; return true ; } return false ; } uploading a zip file is not working help me

    Read the article

  • [PHP] What exactly does it mean when $_FILES is empty?

    - by Mike
    I am working on a PHP upload script and when testing my error checks, I attempted to upload a 17MB TIFF file. When I do this the $_FILES array is empty. The script works fine for what I need it to do, which is to upload JPEG files. My solution is to test if $_FILES is empty or not before continuing with the upload script. Can anybody explain why $_FILES is empty when a TIFF is attempted to be uploaded? Is my solution, to check if $_FILES is empty or not, an okay one? Does this have something to do with settings in php.ini?

    Read the article

  • uploading via http post (multipart/form-data) silently fails with big files

    - by matteo
    When uploading multipart/form-data forms via a http post request to my apache web server, very big files (i.e. 30MB) are silently discarded. On the server side all looks as if the attached file was received with 0 bytes size. On the client side all looks like it had been uploaded succesfully (it takes the expected long time to upload and the browser gives no error message). On the server, nothing is logged into the error log. An entry is logged into the access log as if everything was ok (a post request and a 200 ok response). These uploads are being posted to a php script. In the php script, If I print_r $_FILES, I see the following information for the relevant file: [file5] => Array ( [name] => MOV023.3gp [type] => video/3gpp [tmp_name] => /tmp/phpgOdvYQ [error] => 0 [size] => 0 ) Note both [error] = 0 (which should mean no error) and [size] = 0 (as if the file was empty). My php script runs fine and receives all the rest of the data except these files. move_uploaded_file succeeds on these files and actually copies them as 0byte files. I've already changed the php directives max_upload_size to 50M and post_max_size to 200M, so neither the single file nor the request exceed any size limit. max_execution_time is not relevant, because the time to transfer the data does not count; and I've increased max_input_time to 1000 seconds, though this shouldn't be necessary since this is the time taken to parse the input data, not the time taken to upload it. Is there any apache configuration, prior to php, that could be causing these files to be discarded even prior to php execution? Some limit in size or in upload time? I've read about a default 300 seconds timeout limit, but this should apply to the time the connection is idle, not the time it takes while actually transferring data, right? Needless to say, uploads with all exactly identical conditions (including file format, client and everything) except smaller file size, work seamlessly, so the issue is clearly related to the file or request size, or to the time it takes to send it.

    Read the article

  • Upload a Signed Certificate to Amazon EC2

    - by Tam Minh
    I'm very new to Amazon EC2. I am trying to setup https for my website, I follow the offical instruction from amazon doc: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https.html And I get stuck at Upload the Signed Certificate step aws iam upload-server-certificate --server-certificate-name <certificate_object_name> --certificate-body <public_key_certificate_file> --private-key <privatekey.pem> --certificate-chain <certificate_chain_file> As a instruction, I just create a private key (privatekey.pem) and A Certificate Signing Request (csr.pem), but in the command line they request 4 params 1. certificate_object_name 2. public_key_certificate_file 3. *private-key --> I only have this one* 4. certificate_chain_file I don't know where to get 3 remain params, please help to shed a light. Thank you in advance.

    Read the article

  • Compress, enctypt and upload a directory to an FTP server in Linux

    - by Kristoffer L
    I want to acomplish something rather simple (at least it would seem to be): Compress a directory Encrypt the compressed file Upload the compressed & encrypted file via FTP I also want to acomplish this in an automated fashion on Linux server. TrueCrypt is not really an option as it seems it can't complress a single file, instead you have to make a volume that you mount and move the files into. This question answers how to do the the upload and I know how to compress a directory. It is just the encryption that's giving me problems.

    Read the article

  • Compress, encrypt and upload a directory to an FTP server in Linux

    - by Kristoffer L
    I want to accomplish something rather simple (at least it would seem to be): Compress a directory Encrypt the compressed file Upload the compressed & encrypted file via FTP I also want to accomplish this in an automated fashion on Linux server. TrueCrypt is not really an option in this case as it seems it can't compress a single file. Instead you have to make a volume that you mount and move the files into. This question answers how to do the the upload and I know how to compress a directory. It is just the encryption that's giving me problems.

    Read the article

  • non-interactively upload file to sftp server, using password

    - by matt
    Hello Guys, I know, this is not the recommended way to do this. But, I do not have another choice: I've got to set up a cron job that will regularly upload a file to an external SFTP Server (no FTP available, and I do only have a username/password for it but no key.) Still, I need to set up a cron that will regularly connect to that sftp and upload a file. sftp <<EOF put filename exit EOF therefore will not work, because sftp asks for the password, before STDIN is evaluated. What can I do, to pass the Password to sftp? Again: I am aware of the potential security risk, but I really do not have any choice here, and the server from which the file is uploaded is protected rather well.

    Read the article

  • FTP Access Denied when uploading to server

    - by Albert
    Ok, here's the story. I have a server running FTP 'out there' I can connect to it using the admin account, browse files, download files. When I try to upload files, I get 550 Access Denied. I have tried through FileZilla and command line. I have windows firewall turned off (on my machine) I can UPLOAD files from another machine (using the same admin account) on our local network (that means, same public IP) what is the problem? I am running Windows 7, Build 7100 and the other machine on the network is running XP SP3 The thing that gets me though, is that this worked for the last probably 4 months, without a problem, I get back in the office after a weekend today and it won't work...

    Read the article

  • Temporary file storage - script for webserver

    - by Chris
    I'm looking for a script (preferably php) which I can use for to temporarily exchange files. I had such a script before (it was written in flash), but - damn - just can't find it anymore. Here the features I'm looking for: I have a logon, which allows me to create "upload spaces". for these "upload spaces" I define a time how long the space will be available for (until the files are deleted), and who can access it - in the means of typing in an email, and that user gets a link with the "online space", user ID and password. the other user then clicks on the link and uploads the file, and I get (preferably) an email should there be any file changes I get an email before the content gets deleted Now, 3 additional things: - it should be open- source - run on linux (preferably lamp) - no, I dont wanna use dropbox or similar :p Thanks in advance everybody, Cheers Chris

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >