upload

Software error while executing CGI script

ε祈祈猫儿з 提交于 2019-12-02 14:53:12
I have a cgi script for upload which is as follows #!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); my $cgi = new CGI; my $file = $cgi->param('file'); $file=~m/^.*(\\|\/)(.*)/; # strip the remote path and keep the filename my $name = $2; open(LOCAL, ">/home/Desktop/$name") or die $!; while(<$file>) { $data .= $_; } print $cgi->header(); print "$file has been successfully uploaded... thank you.\n"; print $data; The HTML file is as follows <html> <head> <title>Test</title> </head> <body> <form enctype="multipart/form-data" action="upload.cgi" method="post"> <input type="hidden" name=

Drag & Drop File Upload

此生再无相见时 提交于 2019-12-02 14:45:03
So I'm struggling a bit to find what I'm looking for and how to implement it. I have a basic PHP file uploader working, in that a user presses a custom upload button, selects a file and then using JS, it checks for a change (Ie. the user selecting a file) and then submits the form which uploads the image fine. What I also want now is a drag & drop to upload area. So the user can drag an image from their file explorer and drop it in a designated place (not the whole page) and then once that image has been dropped for the form to submit automatically with their image and use the same PHP

How to Create the Upload File for Application Loader?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 14:21:52
When I use Application Loader, I get to the point where it asks me to "Choose..." the file to be uploaded. If I understand correctly, it supposes to be the appName.app file I see under "Products" on my app bundle (I right click it and select "Show in Finder" to get to the specific file in library; then I'm supposed to ZIP it and the ZIP file is what I will choose in Application Loader). First, am I correct with this assumption? if yes... What should I define different in XCode than the way I used to build the application for testing (on simulator and on my personal iPhone)? Should I change the

PHP uploading script - create folder automatically [duplicate]

☆樱花仙子☆ 提交于 2019-12-02 13:36:50
Possible Duplicate: Check if directory exists (PHP) Post deleted - Post deleted - Post deleted - Post deleted Use file_exists function to check if the folder or tree exists, then use PHP mkdir function. The is_dir function checks if a folder exists and mkdir will create the folder if you need to. oktopus Check if there is a directory . If not, create one . Where is the problem? 来源: https://stackoverflow.com/questions/11454053/php-uploading-script-create-folder-automatically

PHP check for errors in input, if no errors execute and upload

天涯浪子 提交于 2019-12-02 13:36:41
I'm currently working on a registration system and ran into some problem. I'll start with pasting a simplified version of the code before: session_start(); if (isset($_SESSION['logged_in'])) { header('Location: #notLoggedIn'); exit; } else { if ($_SERVER["REQUEST_METHOD"] == "POST") { if //if field is empty { //display error } else if //check if any unallowed characters { //display another error } else { //give the checked input a string/variable, ex: $name= ($_POST["name"]); } // Like 4-5 other checks running in the same way as above } $query = $pdo->prepare('INSERT INTO table (a, b, c, d, e)

Insert and move multiple images via jQuery AJAX in CodeIgniter [duplicate]

谁说我不能喝 提交于 2019-12-02 13:31:29
This question already has an answer here: How to insert and move multiple image using codeigniter? 3 answers view: $("#submit").on('click',function(e){ e.preventDefault(); product_name = $("#product_name").val(); category = $("#category").val(); var formData = new FormData(); $.each($("#product_image"), function (i, obj) { $.each(obj.files, function (j, file) { formData.append('product_image[' + i + ']', file); }); }); formData.append('product_name', product_name); formData.append('category', category); $.ajax({ type:"POST", data:formData, processData: false, contentType: false, url:"<?php

runtime exception can't create handler inside thread that has not called looper.prepare error

陌路散爱 提交于 2019-12-02 13:15:24
I am trying to upload a photo with a few other EditText. I got the sample code from an online example and edited it alittle but I'm receiving this error: 08-29 21:36:46.000: E/AndroidRuntime(4566): FATAL EXCEPTION: AsyncTask #1 08-29 21:36:46.000: E/AndroidRuntime(4566): java.lang.RuntimeException: An error occured while executing doInBackground() 08-29 21:36:46.000: E/AndroidRuntime(4566): at android.os.AsyncTask$3.done(AsyncTask.java:299) 08-29 21:36:46.000: E/AndroidRuntime(4566): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) 08-29 21:36:46.000: E

File upload results in file size 0 and error code 0

时间秒杀一切 提交于 2019-12-02 12:41:56
问题 I'm trying to upload an image to a php script. I have a, non-persistent, bug that results in some of the images uploaded has a file size of 0. I have tried to print the _FILES array to my log file, and it shows the error code being 0, which should be ok. These lines: foreach($_FILES['image_file'] as $key => $val){ error_log(date('j/n/o H:i:s')." ". $key ." => ".$val. "\n", 3,$log_path); } Give me these in the log file: 3/10/2012 12:12:54 name => 59175248636.jpg 3/10/2012 12:12:54 type =>

is_uploaded_file() blanks picture file when it is .bmp, why?

∥☆過路亽.° 提交于 2019-12-02 12:40:07
When I upload any file everything looks good. I have those pictures in pics folder. The unknown part is when I upload a bmp file. I check file types to see if they are jpg,gif, etc. But code doesn't reach there. I've also echoed $_FILES['upload'] it was as below: Array ( [name] => picture.bmp [type] => [tmp_name] => [error] => 1 [size] => 0 ) The code is: if( is_uploaded_file( $_FILES['upload']['tmp_name'] ) ) { // it does not reach here when it is bmp. } bmp file size is about 2.5MB and upload_max_filesize = 5M in PHP.ini . I didn't have this issue before. Is there something here I'm doing

javascript/flash library for file upload with file size limit and progress bar

孤街醉人 提交于 2019-12-02 12:37:48
问题 Is there any "mainstream" library used for this purpose? Commonly spread, well maintained, documented etc. I found these (using flash): Uploadify - not many releases, latest 12/2010, no documentation (!) SWFUpload - latest release 03/2010, documentation fancyupload - looks buggy. phpfileuploader - looks heavyweight, and looks commercial (?) I cannot read the licence (you can download it but are you allowed to use it forever without paying?) plupload New version of pure javascript (no flash)