upload

Upload a file from Android to the server via PHP

倖福魔咒の 提交于 2020-01-06 20:16:38
问题 Can anyone help me to make my code work, i.e. upload a file from Android to the server via PHP? I tried it in many different ways but it won't work. I get HTTP Response 200 but the files aren't uploaded on server. The PHP script I'm using for upload is: <?php $uploaddir = 'uploads/'; $uploadfile = $uploaddir . basename($_FILES['uploaded_file']['name']); if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else {

PHP FTP upload error: Warning: ftp_put() [function.ftp-put]: Filename cannot be empty in

拥有回忆 提交于 2020-01-06 15:47:20
问题 I'm having some trouble finishing my FTP file uploader using PHP. I'm using the example from php.net found here: http://php.net/manual/en/ftp.examples-basic.php and have modified the code slightly. <?php //Start session(); session_start(); // Checking the users logged in require_once('config.php'); //Connect to mysql server $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db = mysql_select_db(DB

rename file with django-ajax-uploader

假如想象 提交于 2020-01-06 11:03:50
问题 I am using https://github.com/skoczen/django-ajax-uploader to upload a file in django. It works but I would like to rename the uploaded file during the process. I want to add a timestamp so I am sure it has a unique name. How to do that? 回答1: I finally ended up using jQuery-File-Upload. It allows to define the path of the file inside the view.Example: urls.py url(r'^upload_question_photo/$', UploadQuestionPhoto.as_view(), name="upload_question_photo"), index.html var input=$(this).find("input

restricting the uploading files size in php

穿精又带淫゛_ 提交于 2020-01-06 08:51:52
问题 I am working with multiple file upload in PHP and I also fixed an upload limit of 10MB using the following HTML commands in an upload form PHP file: <input type="hidden" name="MAX_FILE_SIZE" value="10000000"> <input id="infile" type="file" name="infile[]" multiple="true" /> In the PHP file that takes care of upload function I was initially expecting that if I try to upload a file of size greater than 10MB then the function call statement move_uploaded_file($_FILES['infile']['tmp_name'][$i],

Change Name of uploaded files in powermail formular on typo3

老子叫甜甜 提交于 2020-01-06 07:58:08
问题 i hope someone could help me with my question. I have on a typo3 site a form for applications. On this form you have the ability to upload different documents for curriculum vitae and certificates. This form is created with a powermail plugin. The email, generatedfrom the form, should pass a gateway and automatically inserted into a database. And I got some problems with the files. The files should not have the same name. If a candidate load up files with the same name the gateway can not see

Uploading nested JSON objects to Solr

南笙酒味 提交于 2020-01-06 07:41:15
问题 I'm trying to send my inline JSON file to my Solr Database, but I'm having a problem with my nested objects. I have two nested objects inside my _source object which are media_gallery and stock . Before my upload used to crash, but I managed to upload it after a few corrections, but my media_gallery and stock are added as separate objects therefore instead of having the original 1000 objects I get 3000 objects in my Solr DB after my upload. I'm currently using this command to upload my JSON

Uploading nested JSON objects to Solr

二次信任 提交于 2020-01-06 07:41:07
问题 I'm trying to send my inline JSON file to my Solr Database, but I'm having a problem with my nested objects. I have two nested objects inside my _source object which are media_gallery and stock . Before my upload used to crash, but I managed to upload it after a few corrections, but my media_gallery and stock are added as separate objects therefore instead of having the original 1000 objects I get 3000 objects in my Solr DB after my upload. I'm currently using this command to upload my JSON

WCF upload large images as wsHttpBinding

大城市里の小女人 提交于 2020-01-06 05:16:30
问题 I've created a WCF Service to upload images. It works fine with images < 50KB or so but I get "The remote server returned an error: (400) Bad Request." with larger images. I've been looking for ages and tried lots of different things, including setting the maxRequestLength and several other settings. On the client-side of things the web.config is picking it up as a basicHttpBinding and I'm after a wsHttpBinding (for the more up-to-date feature-set). If I manually change the the binding type

WCF upload large images as wsHttpBinding

廉价感情. 提交于 2020-01-06 05:16:12
问题 I've created a WCF Service to upload images. It works fine with images < 50KB or so but I get "The remote server returned an error: (400) Bad Request." with larger images. I've been looking for ages and tried lots of different things, including setting the maxRequestLength and several other settings. On the client-side of things the web.config is picking it up as a basicHttpBinding and I'm after a wsHttpBinding (for the more up-to-date feature-set). If I manually change the the binding type

PHP Upload Script - Filesize and Filetype issue

假装没事ソ 提交于 2020-01-06 04:31:34
问题 I have the following code that am using as an upload script $allowed_filetypes = array('.jpg', '.jpeg', '.gif', '.bmp', '.png'); $max_filesize = 262144; $upload_normal_path = '../uploads/normal/'; $upload_thumb_path = '../uploads/thumbnail/'; if(isset($_POST['Submit'])) { $filename = $_FILES['image']['name']; $filesize = $_FILES['image']['size']; $fileext = substr($filename, strpos($filename,'.'), strlen($filename)-1); if(!in_array($fileext, $allowed_filetypes)){ $upload_status = "The file