Jump to content

Search the Community

Showing results for tags 'UPLOAD'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 23 results

  1. Hello guys, I am new to coding. Currently, I am working on a demo project that uploads a photo and returns with the name of the person. So basically I use HTML and it consists of 2 pages, the first page - for users to upload photos and submit it while the second page - the recognized name in the photo will be shown. In order to make this work, I have a web service that I need to enable it for face recognition to work, firstly on the first page users take picture and press the submit button, the photo will be uploaded to the web service to perform recognition, after the image is recognized it will go to the second page to display the recognized person. The first page has a submit button, which is to upload the photo, but I wanted the submit button to be on the second page as well so that the users can submit another photo, without the need to go back to the first page. Since I want the Submit button on both pages, therefore I used the same code: <form> <div class="upload-btn-wrapper"> <button class="btn">Submit</button> </div> </form> It worked fine on the first page, but not on the second. Whenever I press the Submit button on the second page to upload another picture, the button redirects me back to the first page. Why is that? Hope to get some advises here. Thank You.
  2. Hi all, I use MS Access to keep track of income at various kiosks and each day I create a text file which I would like to upload to my server and save the data to my tables so I can publish the results on a website. My question is about the uploading. The W3 schools example uses a form to pick the file and then uploads with php, as several other help sites have suggested. I already know the name of the file - it's not like a user picking one from his computer - so I'd like to skip the user interface and just tell the 'uploader' which file to use. I just want to click a button and have the whole thing done with, exactly the same every day. I think I've got an idea but wanted to run it by you experts to see if I'm on the right track. I believe the key is to assign $FILES with the name of the file on my computer, instead of getting it from the form and then using that in the move_uploaded_file method to move it to a folder on my server. But I'm not sure how to assign a value to $FILES and what other background things I may have to do to get it to work. Or is it as simple as coding $myFile = $FILES["C:/Users/me/myfolder/myFile.txt"] and then moving it to my target file on the server? I don't want to do a test on it as I realize how much things could get messed up. And I do know there are plug-ins that could do the job, but I want to understand the basics of uploading and code it myself. Thank you for your help. I thought I'd add what I'm hoping could be my solution - but I'm not holding my breath - it seems too simple. Please explain to me what needs to be done. <?php $myFile = $FILES["C:/Users/Me/ThisFolder/myFile.txt"]; // file on my computer $target = "uploads/newKettleInfo.txt"; // where to put the uploaded file if (move_uploaded_file($myFile, $target_file)) { echo "The file " .$myFile. " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } ?>
  3. While uploading a video, not uploading but image and files are uploading. The array after showing array Array( [file] => Array ( [name] => vlc-record-2016-05-08-21h02m18s.mp4 [type] => [tmp_name] => [error] => 1 [size] => 0 )) can any one please help me.
  4. Hi, I'm new to writting code & looking to write a couple of secure web pages. One where you can log in & out securely using a password. Then a second where you can upload & download some files or folders. Any help on where to start, what code (asp/etc) & what best method(s) of encryption I should use? Thanks for any help or advice. Old Guy.
  5. I try to create an Upload with javascript nad progress bar. i found this code in the internet, but i can't change the code for my idea. This is the script sample: var client = null; function uploadFile(){ //Wieder unser File Objekt var file = document.getElementById("fileA").files[0]; var formData = new FormData(); client = new XMLHttpRequest(); if(!file) return; formData.append("datei", file); client.onerror = function(e) { alert("onError"); }; client.open("POST", "upload.php"); client.send(formData);} my first problem is, that the autor used ONE input tag an set no MULTIPLE. I have a multiple input tag. I think it's enoug to change: var file = document.getElementById("fileA").files[0]; to var file1 = document.getElementById("file1").files; //dlete [0] for all files and formData.append("datei", file); to formData.append("file1[]", file);// add [] to create an array is this correct? AND MY IMPORTANT PROBLEM is, that i have more input tags: <form> <input type="file" name="file1"> <input type="file" name="file2"> <input type="file" name="file3"> </form> How can i pass the code for mulitple tags with different names??????? I search since 4 days for an idea. It will be perfect, if i can send all input with ONE clinet. IT's really important to read the files with $_FILES[file1], $_FILES[file2]
  6. wrong topic, sorry
  7. Does anyone know of a good videoformat uploader, such as jwplayer, that i can use on my website to allow users to upload video. I tried jwplayer but i got so many problems whit it, and i think its bad. Any suggestions?
  8. etsted

    checking file size

    this is my video upload script, and i have inserted a max file size check, but i doesnt seem to work, every time i upload a script that is larger than 2mb it checkes the other if statment on the script,, which is wheter or not the user has filled out the forms script: $form =" <form action='upload.php' method='POST' enctype='multipart/form-data'> <input type='text' name='title' placeholder='Title' /> <br /> <textarea rows='8' cols='30' name='description'></textarea><br /> <input type='file' name='file' /><br /> <input type='submit' name='submit' /> </form>"; echo $form; $title = mysql_real_escape_string(htmlentities($_POST['title'])); $description = mysql_real_escape_string(htmlentities($_POST['description'])); if($_FILES["file"]["size"] < 10000000) { if($title && $description) { $path = pathinfo($_FILES['file']['name']); $allowed = array('jpg','jpeg','gif','png','swf','MP4','flv','mgp','mpeg','webm','rm','ram','mov','wmv','avi','MPEG-4'); if(in_array($path['extension'],$allowed)) { include "connect.php"; $name = $_FILES['file']['name']; $temp = $_FILES['file']['tmp_name']; move_uploaded_file($temp, "upload/".$name); $url = "http://localhost:81/upload/$name"; mysqli_query($con, "INSERT INTO videos VALUES('','$title','$name','$url','$description')") or die(mysql_error()); echo "<p>You're file has been uploaded.</p> <br />"; mysqli_close($con); } else { echo "<p>must be a video or a picture</p> <br />"; } } else { echo "<p>You must fill out the form.</p> <br />"; } } else { echo "<p>You're file is to big.</p> <br />"; } } else { echo "<p>You must be logged in, in order to upload a file.</p><br />"; }
  9. Hi, I would like to use <input type=file> to allow user to upload file (pictures, pdf...) and save them as varinary on SQL server. I can do it using asp.net but want to use html5 and javascipt. I imagine it will take some sort of ajax call to a web service written in vb.net. Does someone have an example?or a resoource? My specific questions are how to get the file from the <imput> and pass that file to web service? Thanks John
  10. Hello, I have the following code in a file called upload_file.php: <?php if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; $filename = $_FILES["file"]["name"]; $filetype = $_FILES["file"]["type"]; $title = $_POST['title']; $content = $_POST['content']; $image_pos = $_POST['image_pos']; $publisher = $_POST['publisher']; mysqli_query($con,"INSERT INTO news (title,content,image,image_pos,publisher) VALUES ('{$title}','{$content}','{$filename}','{$image_pos}','{$publisher}')"); if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } }?> and I get the following error: Can someone please help me, my file permissions in the upload folder are 777 and the directory exists. Can you please help with the SQL problem and the File upload? Thanks in advance!
  11. Hello, Can anyone show me a demo of a code, I'm looking for a form that uses text and file upload. I need a form that has details such as title and content, but I also want an image upload where it saves the file to my FTP server in a folder called Uploads and then it saves the filename and extension to the database, along with the other details from the form. Can anyone give me the code and explain it please! Thanks in advance.
  12. yonidebest

    PHP file upload

    I have the following script based on the example script on http://www.w3schools.com/php/php_file_upload.asp . I get the following error now that I my host upgraded the server to PHP 5.5.The error:Strict Standards: Only variables should be passed by reference in /public_html/uploads/upload_file.php on line 7The code: $allowedExts = array("jpg", "jpeg", "pjpeg"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 3000000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { $filename = (rand() * rand()); while (file_exists("images/" . $filename . ".jpg")) $filename = rand() * rand(); move_uploaded_file($_FILES["file"]["tmp_name"], "images/" . $filename . ".jpg"); /* write desc */ $myFile = $filename . ".txt"; $fh = fopen("images/" . $myFile, 'w') or die("can't open file"); fwrite($fh, "age: " . $_POST['age'] . "rn"); fwrite($fh, "religion: " . $_POST['religion'] . "rn"); fwrite($fh, "country: " . $_POST['country'] . "rn"); fwrite($fh, "desc: " . $_POST['desc'] . "rn"); fwrite($fh, "usage: " . $_POST['usage'] . "rn"); fwrite($fh, "time/date: " . date("Y-m-d H:i:s") . "rn"); fclose($fh); } } else { echo "um, eror"; } Can anyone tell my why I get this error and how to fix it? Thanks, Yoni
  13. hello.... I have file foto with name : my foto You.flv_snapshot_00.18_[2013.06.24_12.12.05].jpg I have do upload that foto , the picture move to directori but not save in database.... I think the problem lies name my picture ... .. How to rename foto be name valid more .. thnks Regards ...
  14. dedi

    upload many files

    I want to upload multiple files only with php.for example like my picture.when pressing the Add button, the file appears under the Add button.and after selecting a file, press the update button when the data is saved to the database.I want your help.I was confused to find references to complete my work.thank you
  15. So i have this website wich i first uploaded on a private free web hosting server. Now some images do not show, and i first thought it got to do with tĀ“because it is a slow free server! But that was not the problem since i now uploaded it on fast pay web hosting domain. This one: http://iphonetryck.se/index.php The images are not shown there either! I tried everything i know from making all the images small equaly(because UNIX does not recognise with one big and rest small or something like that...), to make the pictures from indexered to RGB, or to jpg. Neither work! I need help on to why this is happening. I tried to reupload also btw. I attach a picture on how it is suppose to look like - on the index startpage. As you see the index picture to the top left is not there, and the colorimages for the menylinks is not there either. Also some other pictures like the iphone too in one other page.
  16. Hello W3S people again. once again im in a little need of help. at least to get it started, im a little lost in this matter...im in the half-way exams at this week. and we got told to make a admin system that could upload images to products... that part i (CAN) do...but here comes my problem... i dont know the part of resizing the images...any ideas or suggestions would be pretty awsome! and thats not for kidding...i just need a little help for the beginning of it, so i can see the syntax... Hoping answers or suggestions soon!... thanks alot in advance! .
  17. Hi looking for a bit of help, I'm trying to create an upload script that send file to a directory named in the form "uploads/images/$company" I'm not bothered if the dir already exists The issue I'm have is the uploaded files don't end up in the directory set by "$company" they end up in the "images level Any help or advice would be great, its driving me made Cheers Chris <?php //testing postecho "$_POST[nouploads]";echo "<br />";echo "$_POST[company]";//posted from form$nouploads = "$_POST[nouploads]";$company = "$_POST[company]";//make a dir with the same name as company//does not matter if it already existsif (!file_exists ( "uploads/image/$company" )) {mkdir("uploads/image/$company", 0777, true);}error_reporting(E_ALL); //directory to upload to $upload_dir= "uploads/image/$company"; //numver of files to upload passed by form $num_uploads = "$nouploads"; //maximum filesize allowed in bytes $max_file_size = 2000000; //the maximum filesize from php.ini $ini_max = str_replace('M', '', ini_get('upload_max_filesize')); $upload_max = $ini_max * 2000000; //a message for users $msg = 'Please select files for uploading'; //an array to hold messages $messages = array(); //check if a file has been submitted if(isset($_FILES['userfile']['tmp_name'])) { //loop through the array of files for($i=0; $i < count($_FILES['userfile']['tmp_name']);$i++) { //check if there is a file in the array if(!is_uploaded_file($_FILES['userfile']['tmp_name'][$i])) { $messages[] = 'No file uploaded'; } //check if the file is less then the max php.ini size elseif($_FILES['userfile']['size'][$i] > $upload_max) { $messages[] = "File size exceeds $upload_max php.ini limit"; } //check the file is less than the maximum file size elseif($_FILES['userfile']['size'][$i] > $max_file_size) { $messages[] = "File size exceeds $max_file_size limit"; } else { //copy the file to the specified dir if(@copy($_FILES['userfile']['tmp_name'][$i],$upload_dir.'/'.$_FILES['userfile']['name'][$i])) { //give praise and thanks to the php gods $messages[] = $_FILES['userfile']['name'][$i].' uploaded'; } else { //an error message $messages[] = 'Uploading '.$_FILES['userfile']['name'][$i].' Failed'; } } } }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>Multiple File Upload</title></head><body><h3><?php echo $msg; ?></h3><p><?php if(sizeof($messages) != 0) { foreach($messages as $err) { echo $err.'<br />'; } }?></p><form enctype="multipart/form-data" action="upload3.php" method="post"><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>" /><?php $num = 0; while($num < $num_uploads) { echo '<div><input name="userfile[]" type="file" /></div>'; $num++; }?><input type="submit" value="Upload" /></form></body></html>
  18. hello w3schools again, i just have a question this time .today i was trying to adding a upload script to my personal website . by following this tutorial: http://www.w3schools.com/php/php_file_upload.asp so here is my question.if im doing the saving part ''with'' the restrictions on it. what is the syntax for uploading a .torrent/.php/.html/ect file... i mean, before a filetype, there is somfthing that needs to be typed, like now, (image) ect...what is the syntax for making the part of a PHP and TORRENT file. thanks in advance.Hoping answers soon.
  19. Hello everybody Im wondering how can you make page that displays every .jpg, .gif & .pdf files from directories on website table. Im not sure what coding language i have to use, but i think its mostly html. PHP & javascript code will be accepted too. Found solution after some research: http://www.brightcherry.co.uk/scribbles/php-list-all-files-in-a-directory/
  20. How do I get php to put the contents, and only the contents, of a file being uploaded into an array?
  21. On the folder where i upload the pdf, the code to view it is this however i believe the code to view it on the other folder on the serve would be but it is not working can someone help please
  22. I wrote a simple HTML web page on my home computer. It appeared fine as both a .txt and .html. But when I transferred (FTP via FileZilla or Core) it to the webhost (GoDaddy) the text was changed and the webpage contained symbols and Chinese characters. http://www.scottyproductions.org/Blog.html. Main site: www.Scottyproductions.org. I finally was able to upload the web pages directly throught the GoDaddey FTP so they are now working/displaying the text properly. I can't figure out why my script changes when it is uploaded to the webhost by FiliZilla or CORE FTP but not by GoDaddy. When you open the "View" Source" from the website, there are many characters which were not in the original script. GoDaddy says that their server is working properly. I have re-downloaded the current FileZilla program; and this also happens when I use Core FTP. I have deleted the file on the server and overwritten and re-transferred the one from my computer (with normal script) but this has not helped. When the HTML page or TXT file appear on the server they contain unusual character. Any idea why or how it can be corrected. It has now been uploaded and works fine so the web pages are OK.
  23. Hello,I had created a form for users to upload their resumes (only word documents & 1 MB allowed as size), then email it after its been successfully uploaded.Any help?Thanks in advance
  • Create New...