Menu
  • HOME
  • TAGS

Is it possible to send base64 image to an amazon s3 bucket via ngFileUpload post?

angularjs,canvas,amazon-s3,upload,ng-file-upload

With a lot of research i found out that you can send a blob instead of a file unsing ngFileUpload to s3. I used this library to convert my base64 to a blob, and then passed the generated blob instead of the file in the Upload.upload() file parameter....

Dropped image preview in dropper plugin jquery

javascript,jquery,upload,drag-and-drop

@tvshajeer i have made a image preview function who support both gecko & webkit browser if not then it send you the error message. image_preview(files[0].file).then(function(res){ $('img').attr({src:res.data}); }); Check out my answer on fiddle: http://jsfiddle.net/v8pqsczz/1/...

Uploading multiple files using one form

php,pdo,upload,image-uploading

You will stop executing the loop once you run a return, like in your model's if statement. That's why you are only able to upload 1 picture. Removing that statement will probably fix that.

Upload File: Comsuming WCF Web Service Using Java

java,web-services,wcf,upload

I got my answer. It was the matter of assigning valid content type. I was setting content type header.put("Content-type", "application/x-www-form-urlencoded"); After using following content-type, I am able to upload file successfully httpConn.setRequestProperty("Content-Type","multipart/form-data"); ...

undefined index error - image upload same code is working with another example

php,html,mysql,upload,undefined

When uploading file data, you need to set the encoding on your <form> element to multipart, e.g.: <form action="upload.php" method="post" enctype="multipart/form-data"> ...

Issue with views on button click

django,image,twitter-bootstrap,upload,carousel

I'm not sure what you mean by "just the upload selection panel as Intended". Firstly, I see a problem by you returning an empty form if the submitted form is invalid, you should rather return the existing form and show the errors. Your form, upon clicking the upload button will...

CodeIgniter: How can I store a photo name into database

codeigniter,upload,photo

You need to use a variable for $this->do_upload->data() if you would like to insert content into database. Example: $data_file = $this->do_upload->data(); Example: $data_file['file_name'] $data = array( 'file_name' => $data_file['file_name'], 'file_type' => $data_file['file_type'], 'full_path' => $data_file['full_path'], 'raw_name' => $data_file['raw_name'], 'orig_name' => $data_file['orig_name'], 'client_name' => $data_file['client_name'], 'file_ext' => $data_file['file_ext'], 'file_size' =>...

How to Upload file onclick of button of type=button not type=submit in mvc4 using html begin form

file,asp.net-mvc-4,button,upload,submit

@using(Html.BeginForm("Upload","Home",new {@id="frm"})) { <input type="file" id="upld" /> <input type="button" value="upload" id="btn" /> } <script> $('#btn').click(function(){ var has_selected_file = $('#upld').filter(function(){ return $.trim(this.value) != '' }).length > 0 ; if(has_selected_file){ $('#frm').submit(); } else{ alert('No file selected'); } }); I hope this is your requirement ...

766 versus 666 Permissions on an Upload Directory [closed]

php,upload,permissions

Yes, 755 is the way to go because the User need the execute flag to enter the directory. Edit Same issue with 766 if the Web user is either Group or Others. 6 = read/write and lack the execute flag. So 766 wont work if the web server is not...

How to ask the user to upload a file and use it in my code

javascript,json,angularjs,file-upload,upload

As Brian said you can use https://github.com/danialfarid/ng-file-upload. This is my code, based on a sample I found googling around. $scope.$watch('foto', function () { $scope.uploadFile($scope.foto); }); $scope.uploadFile = function () { var file; if ($scope.foto) { file = $scope.foto[0]; } if (!file) return; console.log('uploadfile()'); console.log('file', file); $scope.upload = Upload.upload({ url: '/api/photo',...

Drupal 7 File Field Library

drupal,upload,drupal-7,drupal-modules

I'm using file field sources module: https://www.drupal.org/project/filefield_sources And it works well for me....

ftp_put() error failed to open stream: No such file or directory

php,upload,ftp,tmp

So thanks to Twisty 23 and Jon Stirling's advices, i've solved the issue. Unfortunately noone posted answer(all comments) which bugs me to keep this unsolved, so i'll just answer myself. This is the code i used at the beginning to redirect //store video information into session if(count($_POST) >0 ){ $_SESSION['vid_name']...

Uploading image file and string to php backend using android and post method

php,android,image,post,upload

Directly after dos = new DataOutputStream(conn.getOutputStream()); add following code: dos.writeBytes(twoHyphens + boundary + lineEnd); dos.writeBytes("Content-Disposition: form-data; name=\"Uname\"" + lineEnd); dos.writeBytes(lineEnd); dos.writeBytes(name + lineEnd); dos.writeBytes(twoHyphens + boundary + lineEnd); dos.writeBytes("Content-Disposition: form-data; name=\"thepic\"" + lineEnd); dos.writeBytes(lineEnd); dos.writeBytes(thePic + lineEnd); Remove all your lines with `Uname in them as that did not work....

Gradle ant ftp error: “425 Connection timed out”

ant,gradle,upload,ftp,gradlew

If that error occurs when you launch your program from your home computer, which is usually NAT'ed and does not have a publicly routable IP, you may try to use FTP passive mode. From the Ant task documentation you should simply add passive: 'yes' to your ftpArgs. FTP is such...

Best method for clearing temp upload folder

php,mysql,apache,upload,cron

If the crop and save function is all JS I would recommend you to use the users local file and upload on "save". JavaScript: function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#blah').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } // jQuery...

How to upload/import a file in the new R shiny version 0.12 using DT package

r,datatable,upload,shiny

Your code is fine. Are you sure you're updated to the absolute latest shiny and DT? Both of them have been updated pretty heavily the past couple weeks, so make sure you install their GitHub version. I would guess that one of the packages is not up to date. Note...

Upload image failing in php

php,image,upload

I ended up figuring it out after 3 hours. $target_dir = "upload/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { $uploadOk = 1; } else { $uploadOk = 0; } } if ($_FILES["fileToUpload"]["size"] > 5000000) { $uploadOk =...

File upload using input type=file not working in IE for first file, works on subsequent uploads

javascript,jquery,html5,internet-explorer,upload

IE is apparently less forgiving than Chrome. My issue was that I was triggering the click event before the actual on change function. Changing the order was all that needed to be done. First implement on change, then trigger the click.

Upload picture NO plugin NO activerecord

ruby-on-rails,ruby-on-rails-4,upload,controller

Since you're using form_for, the actual temp file will be in params[:product][:upload]. Try this Within the _form.html.erb partial, change the file_field line to <%= file_field :upload %> Then, within your create action name = params[:product][:upload].original_filename directory = Rails.root.join('app', 'assets','images') # create the file path path = File.join(directory, name) # write...

Image file upload from view to controller parameters returning null in debug

c#,asp.net-mvc,database,image,upload

Just for anyone who finds this and has the same problem I finally found my mistake in the end. I was using partial views and mistakenly had 2 @using(Html.BeginForm).... within both views and once I removed one of them it was working perfectly.

How to render video in browser before uploading it using angularjs?

javascript,html,angularjs,video,upload

I am guessing you are using ng-file-upload directive here, if so, the solution is simple: the html part: <div ng-app='theModule' ng-controller='mainCtrl'> <button ngf-select ng-model="files" accept='video/*' >select video</button> <video controls ngf-src="files[0]" ngf-accept="'video/*'" autoplay></video> </div> the js part: angular.module('theModule', ['ngFileUpload']).controller('mainCtrl', ['$scope', 'Upload', function ($scope, Upload){ }]); if you want to listen to...

Add value to WP Attachment Meta Data

wordpress,upload,orientation,attachment,aspect-ratio

You can write some code for it. Use http://codex.wordpress.org/Function_Reference/wp_get_attachment_metadata to get the width and the height, and then if $width/$height > 1 => landscape, otherwise its portrait. Store this value in the attachment using: http://codex.wordpress.org/Function_Reference/wp_update_attachment_metadata. You can use an action for this, such as: add_action('add_attachment', 'process_images'); Adding the solution as...

Arduino Sublime Text 2. I can compile but can't upload. Error “The system cannot find the file specified”

c++,upload,arduino,sublimetext2

The problem is that the Arduino plugin is 1) ancient, 2) (barely) ported from a TextMate .tmBundle, and 3) only works on OS X. All of the commands rely on programs stored in /Applications/Arduino.app, which you obviously don't have on your Windows system. So, instead of using this plugin, you...

Codeigniter 2.0: Upload various files with form inputs with different names

php,codeigniter,file-upload,upload,codeigniter-2

Change this function Grabar_anuncio() { /* Lot of code */ $directorio = './images/'; $directorio1 = './images/logos/' . $ID . '/'; if (!is_dir($directorio1)) { mkdir($directorio1, 0777, true); } $directorio2 = './images/fotos/' . $ID . '/'; if (!is_dir($directorio2)) { mkdir($directorio2, 0777, true); } $directorio3 = './images/galerias/' . $ID . '/'; if (!is_dir($directorio3))...

C#: Upload Photo To Twitter From Unity

c#,twitter,unity3d,upload,media

I also had the same issue. I solved it by reducing the size of the image I was trying to post. I'm not sure what the limit is but I found 256*256 jpg worked fine. I also noticed your code is a little different to mine. Here's my code Dictionary<string,...

Why I can't receive files on nodeJS server?

javascript,ajax,node.js,post,upload

Need to use formData constructor for uploading the file: https://developer.mozilla.org/en-US/docs/Web/API/FormData Work exemple: $.ajax({ xhr: function(){ var xhr = new window.XMLHttpRequest(); //Upload progress xhr.upload.addEventListener("progress", function(evt){ console.log('up'); uploadProgress(evt); }, false); //Download progress xhr.addEventListener("progress", function(evt){ console.log('down'); }, false); return xhr; }, url : 'upload', type: 'POST', data: data, cache: false, dataType: 'xml', processData:...

PHP condition with IF working incorrect [duplicate]

php,if-statement,upload,condition

your code is returning a 0 when evaluating the string position for the file "phpminiadmin.php" and thus "==" interprets that as FALSE. As an example try using the filename, "aphpminiadmin.php". Your code will then work correctly because strpos returns a 1 which is clearly not false. Thus, the change that...

Uploading a database to server

database,upload,server,local,host

In Direct Admin Under MySQL management, Create a new MySQL database and user with sufficient privileges. Go to PHPmyAdmin, Select the database you just created and choose the import tab. Upload the gz file and hit Go! The localhost database tables are now in your server....

Preview thumbnail of an xls, xlsx, doc, etc file before upload

jquery,excel,upload,preview

There is no way to do this without converting the file first. There are third party services (box view api, google docs viewer), that convert the file and display it in browser, but you have to upload the file first, which kind of defeats the point.

How to override error messages in MultiUploader in GWT

gwt,upload

The fastest way to edit the file "gwtupload-1.0.3\gwtupload\server\UploadServlet.properties" from gwtupload-1.0.3.jar

PHP - blueimp custom upload directory - empty list on reload

php,upload,blueimp,filelist

Solution found! i only made the mistake not to start the session within the index.php of blueimp. after that everything woks like a flaw! Every user gets his own up/Download directory based on his User-ID from DataBase (saved in Session). my working index.php looks now like this: <?php /* SESSION...

How to implement upload component with one upload button in Vaadin?

java,upload,vaadin

Button.setImmediate(true) is used to start upload after file selection (without button click). But you still need to hide the button with CSS. Quote from Book of Vaadin 5.25 Upload: You can also hide the upload button with .v-upload .v-button {display: none} in theme, have custom logic for starting the upload,...

jQuery multiple file upload from scratch

javascript,php,jquery,ajax,upload

You can make use of HTML5 FormData API. https://developer.mozilla.org/en-US/docs/Web/Guide/Using_FormData_Objects var form = new FormData(); for (var i = 0; i < $(this).get(0).files.length; ++i) { form.append('userfiles[]', $(this).get(0).files[i]); } // send form data with ajax $.ajax({ url: 'url', type: "POST", data: form }); Or if you cannot use FormData there is a...

Uploading files using php very slow in xampp

php,mysql,file-upload,upload

It takes much time because, each and everytime all the files are copied to the newfolder. This exceeds the execution time.Only copying the uploaded files makes uploading and copying files fast.

How to convert any image to bitmap image and store in MySQL database using PHP?

php,mysql,bitmap,upload

$imgData = file_get_contents($filename); $img_for_db=mysql_real_escape_string($imgData); save $img_for_db in database and retrive by following way $sql = "SELECT image FROM table WHERE id=1"; $result = mysql_query("$sql"); header("Content-type: image/jpeg"); echo mysql_result($result, 0); ...

$_FILE is empty when upload in PHP

php,jquery,file,file-upload,upload

34 MB + 27 MB = 61MB. So you would be posting 61MB. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size. Depending on your host, changing these two PHP variables can be done in a number of places with the most likely being php.ini...

How to upload file in PHP and store information in SQLi database?

php,file,mysqli,upload

I see you have called the bindParameters() method after calling execute(). It should be the other way round. i.e. $stmt->bind_param('ssis',$complete,$file_name,$fileSize,$myUrl); $stmt->execute(); ......

Dropzone.js - drop outlook emails

javascript,file,upload,outlook,dropzone.js

You cannot do that unless you override the IDropTarget interface of the browser. See Upload fails when user drags and drops attachement from email client

How to prevent duplicate filenames in laravel?

php,file,laravel,upload,eloquent

There are a few things you could do. If the original filename already exists, the following code will look for an integer in it before the extension. If there isn't one it adds one. Then it increments this number and checks until such a filename doesn't exist. if (Storage::exists($fileName)) {...

How to create file upload like gmail?

javascript,jquery,file-upload,upload

Try this code.... <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>File(s) size</title> <script> function updateSize() { var nBytes = 0, oFiles = document.getElementById("uploadInput").files, nFiles = oFiles.length; for (var nFileId = 0; nFileId < nFiles; nFileId++) { nBytes += oFiles[nFileId].size; } var sOutput = nBytes + " bytes"; // optional code for...

php form upload noname attachment

php,forms,upload,email-attachments

Change your code as follow hope will works. for($x = 0; $x < count($files); $x++){ if(file_exists($files[$x])) { $file = fopen($files[$x],"r"); $content = fread($file,filesize($files[$x])); fclose($file); $content = chunk_split(base64_encode($content)); $message .= "Content-Type: {\"application/octet-stream\"};\n" . " name=\"$files[$x]\"\n" . "Content-Disposition: attachment;\n" . " filename=\"$filenames[$x]\"\n" . "Content-Transfer-Encoding: base64\n\n" . $content . "\n\n"; $message .= "--{$boundary}\n";...

Laravel 5, attempting multi-file upload, Request::file() only returning last file?

php,http,laravel,upload,laravel-5

use array of file element as html like follow <input type="file" name="photo[]"> <input type="file" name="photo[]"> add enctype attribute in form and in laravel to get file use the key of the file as follow $files = Request::file('photo'); $names = []; foreach ($files as $file) { $names[] = $file->getClientOriginalName(); } return...

How do i properly refer to the indexes within $_FILES?

php,arrays,image,upload

You are missing the index as designated as $index in my example code: This assumes your HTML in my snippet is similar to yours. This applies to inputs that have the multiple foreach ($_FILES["add_prod_image"]["name"] as $index=> $image) { $target_file = $target_dir . basename($image["name"][$index]); } The "proper" way to retrieve multiple...

Multiple file upload with VlabsMediaBundle in Symfony2

php,symfony2,upload,bundle

I was a little bit investigating about your problem and Vlabs Media Bundle seems to be unmaintained. There is form listener on PRE_SET_DATA event (Vlabs\MediaBundle\EventListener\BaseFileListener::preSetData()) that is not compatible with new version of Symfony (it expects DataEvent as parametr instead FormEvent). They fixed it but after 1.1.1 release (you can...

Can CDNs handle base64 encoded data?

image-processing,upload,xmlhttprequest,base64,cdn

CDNs usually do not provide such uploading service for client side, so you can not do it in this way.

Coping file from inputstream to outputstream results in bad copy

java,file,servlets,upload

You're writing all the content of of buf array. This could be problem for last read. change the while loop with this. int n; while ((n = bin.read(buf)) != -1){ bout.write(buf, 0, n); } ...

Upload IPA, strange issue: ERROR ITMS-90032:“Invalid Image Path - No image found at the path referenced under key '$key': '$path'

ios,xcode,upload

<string>Icon-Splotlight-iOS7.png</string> <string>[email protected]</string> Could be this typo for the Spotlight images....

Upload image to server not working

php,curl,file-upload,upload,image-uploading

You must use a system path when using move_uploaded_file() rather than an http:// call. I.e.: $targetPath = "/var/user/httpdocs/webtools/ondequemvaiver/agora/img/... or $targetPath = "webtools/ondequemvaiver/agora/img/... depending on the location of the script's execution. You also need to make sure that the folder(s) has proper permissions in order to be written to. Add error...

Unity3D, C# and uploading tracks to SoundCloud

android,unity3d,upload,soundcloud

It's working!! The problem was that at some point i used StringBuilder.AppendLine() to add a new line. This works fine on Windows, but on Android it didn't work... (i figured it out because the Content-Length was not the same for Windows and Android.) I fixed it by instead of using...

Error while uploading image to server with Swift

swift,post,upload,server,multipartform-data

A couple of observations: In your content-disposition for the image name, you have \\r where you obviously meant \r. Your request is not terminated properly. You should have a -- after the last boundary, but before the \r\n (e.g. the format string for that last boundary should be \r\n--%@--\r\n). Regarding...

Uploading a video to vimeo via the API in ruby

ruby,upload,vimeo

HTTParty is the wrong tool to use for this. Changing it to work with the normal Net::HTTP lib did the trick. File.open("movie.mp4", "rb") do |f| uri = URI(target) while last_byte < size do req = Net::HTTP::Put.new("#{uri.path}?#{uri.query}", initheader = { "Authorization" => auth, "Content-Length" => size.to_s, "Content-Range" => "bytes: #{last_byte}-#{size}/#{size}"} )...

Thumbnails in media library not showing after upload path change

wordpress,upload,directory,media

Try to use the below plugin to re-generate your site thumbnails, as Wordpress saves also the path in database: Regenerate Thumbnails And also do check if you have given a permission to 755 if not do give your new upload folder a permission 755 Hope this helps you, anything else...

Php image upload wont go into set directory

php,sql,upload

Have you checked the permissions of the new folder you're trying to upload to?

How can I upload files to dropbox using JavaScript?

javascript,angularjs,file-upload,upload,dropbox

Their API should allow you to do this using one of the languages they support directly. The list of supported languages is here.

php upload smaller image version of original

php,image,upload,webserver

I wrote something for you : Please keep using : DIRECTORY_SEPARATOR const <?php /** * @brief Resize an image with keeping aspect ratio * * @param [in] $src_image_path :: Source image path => "C:\www\abstract.jpg" * @param [in] $dst_image_path :: Destination image path => "C:\www\abstract2.jpg" * @param [in] $new_width :: Width...

Progress percentage from browser on POST multipart request. GWT

post,gwt,upload,progress-bar,progress

Since progress is not yet implemented in XMLHttpRequest, neither send a FormData, I would do with gwtquery Ajax. I did an example in my last GWT.create presentation: final GQuery progress = $("<div>").css($$("height: 6px, width: 0%, background: #75bff4, position: absolute, top:0px")).appendTo(document); GQuery fileUpload = $("<input type='file' multiple >").hide().appendTo(document); fileUpload.trigger("click"); $(fileUpload).on("change", (e)...

Why does submitting an upload form not send data?

php,sql,forms,upload

The problem has been found I was a dummy, and did a typo in one of my $_POST['names']; Thanks to everybody who tried to help me.

PHP upload + dropzoneJS : allow only some files extensions

php,upload,dropzone.js

First of all, it doesn't matter if its the dropzone sending the file or a file upload input. It eventually is going to end up in the variable $_FILES. Even if restricted by the dropzone, you should keep the validation server side. So all you needed to search for was,...

Perl FTP uploading empty file to server

perl,upload,ftp

You have to close the strem befor transfer it to the remote host: open(DATA, ">$file") || die(print("I cannot save to the file [$file]")); print("Created file [$file]\r\nWriting data to file. Please be patient..."); foreach(@file){ print DATA $_ . "\r\n"; $indexer++; print ".\b"; } close(DATA); ...

Changing file name to the user's name PHP

php,file,upload

You need to change your $target_file variable to the name you want, since this is what gets passed into move_uploaded_file(). I don't see anywhere in your code where you actually set this variable to their username (right now it's still using the name they selected when they uploaded it). Without...

Dropzone autoprocess queue false not working if there is an error like maxfilesize,maxfileuploads etc

jquery,file-upload,upload,dropzone.js

this.on("queuecomplete", function (file) { var size = thisDropzone.files[0].size/1000000; if(thisDropzone.files[0].type== "image/jpeg" ||thisDropzone.files[0].type=="image/jpg" || thisDropzone.files[0].type=="image/png" && size<5) listingSubmitted(); }); ...

Deployment PhpStorm gone

deployment,upload,phpstorm

Make sure that "Remote Hosts Access" plugin is enabled. Enable and restart IDE if not. If it's enabled but still nothing -- check Keymap if Deployment actions are there. If there -- maybe you have somehow removed them from Menus. For that -- reset menus & toolbars (or add those...

Getting “filetype not allowed” with Codeigniter upload

php,codeigniter,file-upload,upload,mime-types

I found the solution: Codeigniter 2.1.4 has a bug as described here. So I've update CI to version 2.2.1, folowing the update instrucions here and here. After checking the mimes.php file for a second time, I noticed a difference between my original file, and the one included in the newer...

Uploading file with Python and Alfresco API

python,curl,upload,alfresco

You can use the very simple library Requests. import json import requests url = "http://localhost:8080/alfresco/service/api/upload" auth = ("admin", "admin") files = {"filedata": open("/tmp/foo.txt", "rb")} data = {"siteid": "test", "containerid": "documentLibrary"} r = requests.post(url, files=files, data=data, auth=auth) print(r.status_code) print(json.loads(r.text)) Output: 200 {'fileName': 'foo.txt', 'nodeRef': 'workspace://SpacesStore/37a96447-44b0-4aaa-b6ff-98dae1f12a73', 'status': {'code': 200, 'description': 'File uploaded...

Alamofire not sending upload-request (no connection established at all)

ios,swift,upload,alamofire

To sum up all comments: always print out / listen to NSError values returned from Alamofire (or Core Data, or anything else). The only way they can communicate back to your code is through these errors the problem was that a file path ended in a path separator, i.e. /path/to/my/file.txt/...

Post Name to php MYSQL database

javascript,php,mysql,unity3d,upload

You need quotes around $phpSign, since it's a character, not a number. if($mysql->query("UPDATE premium SET signup = '$phpSign' WHERE (id, randomChar) = ('$device', '$randomChar')")) { die("success"); } else { die("error|5:" . $mysqli->error); } As I've shown, when the query fails you should display the MySQL error message, not just a...

Uploading file from android to server fails

java,android,http,file-upload,upload

There was a stupid problem:) My app runs a NanoHttpd server and I upload files to it. Then I have a button to upload files to a server on the net. The problem is I upload whatever is uploaded to me! (I didn't put the parameters in the code in...

Why when I try to upload an Image with Windows Phone it uploads a random thing?

c#,php,upload,windows-runtime,windows-phone-8.1

You need to pass your byte[] data through a BitmapEncoder to convert it into a common image format (e.g. BMP, PNG, JPEG) before uploading. At the moment you are just sending the raw ARGB pixel data with no information about how it should be interpreted. For example, to encode as...

Import photo to imageview

ios,swift,upload,imageview

Here you have sample code form Apple Developer service: link This sample app inserting chosen image form Image Picker into UIImageView. Please analyze this sample, it should help you resolve your problem. And here you have some related tutorial: UIImagePickerController tutorial...

Warning: getimagesize(image.jpg) [ ]: failed to open stream: no such file or directory

php,upload,resize-image

php can't access files from client system directly. Here you are trying to access $_FILES['txtfile1']['name'] instead try getimagesize($_FILES['txtfile1']['tmp_name'])

Upload image codeigniter

php,image,codeigniter,upload

Are you sure that our form field name is story_img? Try to add conditionals: if($this->upload->do_upload('story_img')) { //your code... } And try to display smth in conditional,to see if you pass it....

PHP image uploads - moving from one type to many

php,image,upload,gd

You will want to create the image from the beginning as the intended file. Here is a class I use, and then added into your class. You can copy from the one class to the other, but you can see where you need to change things at least: class AvatarModel...

Upload Image using ajax (json)

php,ajax,image,upload

The idea in SO is to work on the OP current code. I mean, we are not here to make all the job, because it should have a price. Anyway, here is a workaround for your issue: Convert your image to base64 using javascript. This useful method works like a...

upload CSV file to database on Google app engine using Python

python,database,google-app-engine,csv,upload

You can upload your files into blobstore, using blobstore api Once you upload your file in blobstore, you get blobkey, then you can use blobreader, to read csv file content and store them according in your database. Hope it helps....

Change upload_dir folder at a certain cpt but cant change back

wordpress,upload,wordpress-plugin,wordpress-plugin-dev,custom-post-type

I found! this will only change the upload dir when upload in the "rsg_download" CPT add_filter( 'wp_handle_upload_prefilter', 'rsg_pre_upload' ); function rsg_pre_upload( $file ) { add_filter( 'upload_dir', 'rsg_custom_upload_dir' ); return $file; } function rsg_custom_upload_dir( $param ) { $id = $_REQUEST['post_id']; $parent = get_post( $id )->post_parent; if( "rsg_download" == get_post_type( $id )...

Upload image in directory

php,image,upload

Simple Example: HTML <form action='upload.php' method='post' enctype='multipart/form-data'> <input name='filename' type='file' /> <input name='btnSubmit' type='submit' /> </form> PHP <?php $filename = $_FILES["filename"]["name"]; $tmpFilename = $_FILES["filename"]["tmp_name"]; $path = "path/to/upload/" . $filename; if(is_uploaded_file($tmpFilename)){ // check if file is uploaded if(move_uploaded_file($tmpFilename, $path)){ // now move the uploaded file to path (directory) echo "File uploaded!";...

Why UploadProgressChanged in WebClient.UploadFileAsync work not correctly?

c#,wpf,file-upload,upload

My solution: private void FileUploadProgressChanged(object sender, UploadProgressChangedEventArgs e) { ProgressBarUpload.Value = e.BytesSent * 100 / e.TotalBytesToSend; } I also found two questions similar to this, but I have not managed to solve the problem. But it can be useful to others: WebClient UploadFileAsync strange behaviour in progress reporting (cause of...

PHP upload script not functioning and no error on apache logs

php,upload

This line: $target = $target_path . basename($_FILES['uploadedfile']['name'][0] ); As it stands, $target is just a stray variable and not being used anywhere else. It should read as: $target_path = $target_path . basename($_FILES['uploadedfile']['name'][0] ); "I created an upload script using the resources from tizag" The Tizag tutorial you followed doesn't change...

FTP not working on any FTP client not even with Mozilla or Chrome

osx,upload,ftp

There is most likely a NAT-firewall between you and the servers showing the symptom. (NAT-firewalls hide a whole network behind a single IP-number). See http://slacksite.com/other/ftp.html for a more detailed explanation....

Upload an image or a txt and add it into a web page automatically

php,upload

If you need to do that, then using the database and store the uploaded items in its coloumn is the better way.. But to answer your question You can do something like this. Step 1 : Read all the files in your directory $dir = 'up/'; $files = scandir($dir); Step...

how should i import a huge table in phpmyadmin

php,mysql,upload,phpmyadmin

I could solve my problem with the help of @vohuman. To get rid of the limitations of import (and even export), you should use command line, Or in the words of @vohuman: @vohuman: 'Log into mysql shell and source the sql file' So, to import a .sql file (for windows...

Storing a file into a database & uploading it in a webpage [closed]

php,mysql,database,file-upload,upload

I would suggest you to create a database table having fields having the userId, and path of the file. The file uploaded should be saved in the Web Server, and its path need to be saved in the database. The vice-versa should be done while retrieving the file content....

Media files end up in in a pycharm subdirectory when uploading

django,upload,directory,settings,media

Your BASE_DIR should look like: os.path.dirname(os.path.dirname(__file__)) ...

Multiple File Upload Code for Django

python,django,file,upload

I'm not sure whether I've missed something. Yes : reading the error message - which tells you what the error is -, the traceback - which tells you where the error happened - and then re-reading your code. So you have: Exception Type: TypeError Exception Value: cannot concatenate 'str'...

C++ Array based on external file

c++,arrays,function,file,upload

You are passing the dataX and dataY arguments by value, which means they are copied and inside the function you only allocate memory for the local copies and not the original. Change the function to void loadInputFile(std::string file_name, float*& data_X, float*& data_Y, int& data_size, int& centre_interval) ...

how to upload multiple files, store their paths in different columns in a mysql database row

php,mysql,file,upload,path

you have to change their as $pic1=($_FILES['photo1']['name']); $pic2=($_FILES['photo2']['name']); $pic3=($_FILES['photo3']['name']); for($i=1;$i<=3;$i++) { if(move_uploaded_file($_FILES['photo'.$i]['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not echo "Sorry,...

Shiny reactive scan of archive, then write() it to download, fails in cat() -> argument type “closure” not handled

r,download,upload,shiny

Realized there were 2 problems: "inFile" and "archive" vars had to be inside an "observe({})" statement. In order to ve visible to the downloadHandler, archive must be assigned with the "<<-" operator, not "<-", in order to be a global var. ...

scala/play - Make a File object from an uploaded file

file,scala,playframework,upload

According to the documentation it should work this way: request.body.file("dataFile").map( currentFile => { // How to make a FILE object from currentFile import java.io.File val filename = currentFile.filename val contentType = currentFile.contentType val myFile = new File(s"/tmp/somepath/$filename") currentFile.ref.moveTo(myFile) //now "myFile" is an object of type "File". } ) ...

How to get $_GET variables from referrer url in Yii?

ajax,url,yii,upload,get

1st. Add rule to your config url rules: 'urlManager' => array( 'urlFormat' => 'path', 'showScriptName' => false, 'rules' => array( ......... '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', ......... ), ), 2nd. Your action will look like this: public function actionAjaxTest($id) Where $id=123 from your url '/controller/ajaxTest/123' for example. 3rd. Where you generate url...

How do I upload a file via HTML before passing it to a Javascript function?

javascript,html,function,file,upload

For this, you would want to use the Javascript File Reader. First, you'd want to get the file from the input element: //Gets files from document element var files=document.getElementById('rand').files; //Selects first File and assigns it to file var file=files[0]; Then you'd want to create the filereader: var reader = new...

Add metadata (Exif) to base64

javascript,canvas,upload,exif

There is no easy way to do this. Canvas will only save out the JPEG file, then encode it as either a Data-URL or a Blob depending on the method you chose with the most basic chunks. There is no mechanism to insert custom or additional chunks into the file...

Selenium - upload file to iframe

python,selenium,iframe,selenium-webdriver,upload

Lets try this by giving some time for iframe to load by inserting the below code Import time ## Give time for iframe to load ## time.sleep(xxx) hope this will work...

Codeigniter upload file and resize

codeigniter,upload,resize

Final Edit: Used initialize to pass the configs instead of passing them directly to load->library: if ($this->upload->do_upload()) { $data = $this->upload->data(); $image = $data['file_name']; $config['image_library'] = 'gd2'; $config['source_image'] = './uploads/devices/'.$image; $config['maintain_ratio'] = TRUE; $config['width'] = 400; $config['height'] = 300; $this->load->library('image_lib'); $this->image_lib->initialize($config); $this->image_lib->resize(); $localPath = './uploads/devices/'.$image;...

PHP Image Upload Not Resizing When Sent Via JS

javascript,php,upload,image-uploading,image-resizing

I would maybe try installing ImageMagick in your linux distribution and try to use this function to resize the image http://php.net/manual/en/imagick.resizeimage.php I have reproduced your script on my webserver... I have made modifications and came up with this. The most significant modification is that I am using exact paths in...