Search Results

Search found 386 results on 16 pages for 'fileupload'.

Page 10/16 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How can I prevent double file uploading with Amazon S3?

    - by Tony
    I decided to use Amazon S3 for document storage for an app I am creating. One issue I run into is while I need to upload the files to S3, I need to create a document object in my app so my users can perform CRUD actions. One solution is to allow for a double upload. A user uploads a document to the server my Rails app lives on. I validate and create the object, then pass it on to S3. One issue with this is progress indicators become more complicated. Using most out-of-the-box plugins would show the client that file has finished uploading because it is on my server, but then there would be a decent delay when the file was going from my server to S3. This also introduces unnecessary bandwidth (at least it does not seem necessary) The other solution I am thinking about is to upload the file directly to S3 with one AJAX request, and when that is successful, make a second AJAX request to store the object in my database. One issue here is that I would have to validate the file after it is uploaded which means I have to run some clean up code in S3 if the validation fails. Both seem equally messy. Does anyone have something more elegant working that they would not mind sharing? I would imagine this is a common situation with "cloud storage" being quite popular today. Maybe I am looking at this wrong.

    Read the article

  • Restrict allowed file upload types PHP

    - by clang1234
    Right now I have a function which takes my uploaded file, checks the extension, and if it matches an array of valid extensions it's processed. It's a contact list importer. What I need to figure out is how to be sure that file (in this case a .csv) is actually what it says it is (ex. not an excel file that just got renamed as a .csv). Our servers run PHP 5.2.13 Here's the current validation function I have public static function validateExtension($file_name,$ext_array) { $extension = strtolower(strrchr($file_name,".")); $valid_extension="FALSE"; if (!$file_name) { return false; } else { if (!$ext_array) { return true; } else { foreach ($ext_array as $value) { $first_char = substr($value,0,1); if ($first_char <> ".") { $extensions[] = ".".strtolower($value); } else { $extensions[] = strtolower($value); } } foreach ($extensions as $value) { if ($value == $extension) { $valid_extension = "TRUE"; } } if ($valid_extension==="TRUE") { return true; } else { return false; } } } }

    Read the article

  • is it possible to continue a file upload after a browser has been quit?

    - by sprugman
    If a user starts uploading a file (in a web app), and they close their browser before the upload completes, what happens? My guess would be that the upload gets abandoned, and the server has some garbage cleaning mechanism that kicks in eventually, but I'm not sure. Any difference between servers or server languages? Any difference between quitting the browser and just closing a window?

    Read the article

  • drupal POST Content-Length exceeds the limit

    - by Arun
    hi i got list of warning regarding file size when i try to upload an image using file upload. "POST Content-Length of 12223490 bytes exceeds the limit of 8388608 bytes in Unknown on line 0" My question is how to avoid displaying warning messages (i got 5 warnings).

    Read the article

  • Can somehow show progress on file upload without using AJAX?

    - by nimo
    Let's say that I upload a file using a basic multipart post. The server then receives the request and starts to execute the server side code. Can I somehow in that state start to output the response and after some data is sent start to receive the file? Finally when the file is uploaded I output the rest of the response. If this is possible I can display file upload progress without using ajax? I guess this might depend on what I run server side. But let's assume that I have full network control.

    Read the article

  • Upload File Directly to S3 with Progress Bar

    - by John Boker
    Relating to this question, http://stackoverflow.com/questions/117810/upload-files-directly-to-amazon-s3-from-asp-net-application, is there any way to do this and have a progress bar? ---- EDIT ---- Two days later and still no luck with a direct way. Found one thing that looks promising but not free: http://www.flajaxian.com/ Uses flash to upload directly to S3 with a progress bar.

    Read the article

  • [Concept] How does unlink() find the file to delete?

    - by Prasad
    My app has a 'Photo' field to store URL. It uses sfWidgetFormInputFileEditable for the widget schema. To delete the old image when a new image is uploaded, I use unlink before setting the value in the over-ridden setter and it works!!! if (file_exists($this->_get('photo'))) unlink($this->_get('photo')); Photos are stored in uploads/photos and when saving 'Photo' only the file name xxx-yyy.zzz is saved (and not the full path). However, I wish to know how symfony/php knows the full path of the file to be deleted? Part 2: I am using sfThumbnailPlugin to generate thumbnails. So the actual code looks like this: public function setPhoto($value) { if(!empty($value)) { Contact::generateThumbnail($value); // delete current Photo & create thumbnail $this->_set('photo',$value); // setting new value after deleting old one } } public function generateThumbnail($value) { $uploadDir = sfConfig::get('app_photo_upload'); // path to upload folder if (file_exists($this->_get('photo'))) { unlink($this->_get('photo')); // delete full-size image // path to thumbnail $thumbpath = $uploadDir.'/thumbnails/'.$this->get('photo'); // read a blog, tried setting dir manually, doesn't work :( //chdir('/thumbnails/'); // tried closing the file too, doesn't work! :( //fclose($thumbpath) or die("can't close file"); //unlink($this->_get('photo')); // doesn't work; no error :( unlink($thumbpath); // doesn't work, no error :( } $thumbnail = new sfThumbnail(150, 150); $thumbnail->loadFile($uploadDir.'/'.$value); $thumbnail->save($uploadDir.'/thumbnails/'.$value, 'image/png'); } Why can't the thumbnail be deleted using unlink()? is the sequence of ops incorrect? Is it because the old thumbnail is displayed in the sfWidgetFormInputFileEditable widget? I've spent hours trying to figure this out, but unable to nail down the real cause. Thanks in advance.

    Read the article

  • File upload issue

    - by Varun
    I am working on a PHP based, ticket management system. While creating a ticket, one can upload an attachment. I want to put a limit (say 10 MB) per file upload. To implement this I plan the following- 1. In php.ini set post_max_size = 10M 2.In PHP script which receives the POST- Since the file is larger than post_max_size, $_FILES[] will be empty. But I can still check the content-length header and discard the upload, if size more than 10M. While testing this I tried uploading a file of 1 GB and analysed the http traffic and this is what I found. - the entire 1 GB data is first uploaded to a to the server temporarily and discarded once the http request completes. Though I couldn't exactly find out where the file was getting saved(as it was not there in the temporary directory in the server.), but my http traffic analyzer showed that the browser did send 1 GB data to the server. - the PHP script execution started only after completion of the http request(i.e after uploading the entire 1 GB) Now I have 2 concerns: a) People may exploit my server bandwidth by trying to upload large file, which I will have to discard anyways. b) Even worse, if someone starts uploading a huge file (say 100 GB), entire 100 GB data is first uploaded to the server temporarily, that means for that period, it will consume that much of memory on my server. What's the common solution for this. Am I missing something here?

    Read the article

  • even small file upload stops activity on apache/rails

    - by Pavel K.
    on my rails(2.3.5) app(currently 50-70rpm, maximum response time around 0.7s), uploading even 700k file(using paperclip plugin) locks up the server for web requests for everyone for 2 minutes! (other apps on same server work normally) does anyone have a clue why that might be happening? i am using some mysql transactions which lock the database also if that might be an issue i read http://www.therailsway.com/2009/4/23/uploading-files but it couldn't be locking server for 2 minutes for a small file, could it?!

    Read the article

  • When and How to Delete temporary uploaded but uncommitted files in ASP.NET

    - by slowlycooked
    I'm using EO Ajax toolkits for upload files, the file is uploaded to server. when user click save then it will update the database for what been uploaded or changed. Now i need a clean up process that when user uploaded a file to server, but then close his/her browser before click the save button. in this case how should i programe so that the file user just uploaded is deleted, because it's now useless and not assosiated with any database. thanks. maybe i should upload all files to a temp folder, only when user click saver the file can be moved to target folder, at each session end the temp folder is get deleted.

    Read the article

  • $_FILES is null, $_POST is not null

    - by Cory Dee
    When I am going to upload a file, my $_POST variable knows the file name, but the $_FILES variable is null. I've used this code before, so I'm really stumped. Here's what I'm using for input: <label for="importFile">Attach Resume:</label> <input type="hidden" name="MAX_FILE_SIZE" value="10000000"> <input type="file" name="importFile" id="importFile" class="validate['required']"> And for processing: $uploaddir = "E:/Sites/OPL/2008/assets/apps/newjobs/resumes/"; $uploadfile = $uploaddir . time() . '-' . urlencode(basename($_FILES['importFile']['name'])); if (!move_uploaded_file($_FILES['importFile']['tmp_name'], $uploadfile)) { echo 'Error uploading file. Error number: ' . $_FILES['importFile']['error']; var_dump($_FILES['importFile']); echo $_POST['importFile']; die(); } Which is giving me this result: Error uploading file. Error number: NULL Maintaining The OPL Website.doc Any help would be greatly appreciated.

    Read the article

  • Having trouble uploading a file

    - by neo skosana
    Hi I am having trouble uploading a file. First of all I have a class: class upload { private $name; private $document; public function __construct($nme,$doc) { $this->setName($nme); $this->setDocument($doc); } public function setName($nme) { $this->name = $nme; } public function setDocument($doc) { $this->document = $doc; } public function fileNotPdf() { /* Was the file a PDF? */ if ($this->document['type'] != "application/pdf") { return true; } else { return false; } } public function fileNotUploaded() { /* Make sure that the file was POSTed. */ if (!(is_uploaded_file($this->document['tmp_name']))) { return true; } else { return false; } } public function fileNotMoved($repositry) { /* move uploaded file to final destination. */ $result = move_uploaded_file($this->document['tmp_name'], "$repositry/$this->name.pdf"); if($result) { return false; } else { return true; } } } Now for my main page: $docName = $_POST['name']; $page = $_FILES['doc']; if($_POST['submit']) { /* Set a few constants */ $filerepository = "np"; $uploadObj = new upload($docName, $page); if($uploadObj->fileNotUploaded()) { promptUser("There was a problem uploading the file.",""); } elseif($uploadObj->fileNotPdf()) { promptUser("File must be in pdf format.",""); } elseif($uploadObj->fileNotMoved($filerepository)) { promptUser("File could not be uploaded to final destination.",""); } else { promptUser("File has been successfully uploaded.",""); } } The errors that I get: Warning: move_uploaded_file(about.pdf)[function.move-uploaded-file]: failed to open stream: No such file or directory in... Warning: move_uploaded_file()[function.move-uploaded-file]: Unable to move 'c:\xampp\tmp\php13.tmp' to 'about.pdf' in... File could not be uploaded to final destination.

    Read the article

  • AJAX file upload

    - by farjimain
    I have a control for uploading an image and above it is an image control. When User clicks 'Upload' button, image turns to an animated image displaying 'WAIT' message, after the image is uploaded, the image source changes to that image. I want to do this using simple AJAX, JAVASCRIPT (xmlHTTP objects) , ASP.NET, VB.NET. Can anyone help me out??? Don't wanna use iframe or flash besides above four.

    Read the article

  • Multiple file upload in php.....

    - by udaya
    I want to upload multiple files and store them in a folder and get the path and store it in the database... Any good example you looked for doing multiple file upload... Note: Files can be of any type...

    Read the article

  • Magento "File was not uploaded"

    - by John
    I'm currently using the magento admin interface, trying to upload an image in the "manage products" and I get the error "file was not uploaded" after I browse the file and click "upload file". I've looked on other forums and the main solution I saw were to make sure that php.ini has the following lines... magic_quotes_gpc = off short_open_tag = on extension=pdo.so extension=pdo_mysql.so I have Windows/IIS with ISAPI_Rewrite. Is there a max file upload size that I can change somewhere. I'm uploading pictures from my local desktop of size ~100kb. help!

    Read the article

  • Is there an easy way to add a secure file upload form (username, password, select file) to a website

    - by user346602
    Hi, I am very new to website design. Have an architect who wants his clients to enable his clients to upload (ftp - but don't know if http could be a better alternative?) files (plans etc.) to him, through the website I'm designing for him. I have seen similar things available on printers websites... I have seen uploadify, but it requires flash (I can only code HTML, CSS and a tiny bit of PHP), and don't think it is a secure option. I have also seen net2ftp, but don't really understand how it works. Any direction would be sincerely appreciated.

    Read the article

  • Browser, upload large file

    - by Mike
    I'm looking for a way to allow a user to upload a large file (~1gb) to my unix server using a web page and browser. There are a lot of examples that illustrate how to do this with a traditional post request, however this doesn't seem like a good idea when the file is this large. I'm looking for recommendations on the best approach. Bonus points if the method includes a way of providing progress information to the user. For now security is not a major concern, as most users who will be using the service can be trusted. We can also assume that the connection between client and host will not be interrupted (or if it is they have to start over).

    Read the article

  • Start SharePoint workflow only with new file versions

    - by NeiOliver
    I am trying to create a workflow to send an e-mail whenever a new version of a file is uploaded to a Document Library. The Document Library has lots of fields that, if updated, will create a new version of the ListItem, but I don't want to start the workflow for this cases. Only when a new version of the document is uploaded (including the first version) I want the workflow started. My document library does not need approval, only major versions are enabled and it does not need to checkout files before editing. Is there a way of doing this, even programmatically?

    Read the article

  • How do I upload a file when I know the client's filepath?

    - by GJTorikian
    I'm interested in the way Sonic Living detects your iTunes library XML file. It prompts the user to approve its actions, then automatically uploads the XML file based on the client OS (and assuming the default installation path of iTunes). How the heck does it do that? None of the upload libraries I've looked at have this feature. They all assume that a user will click "Select file..." then browse around for the right thing to upload.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16  | Next Page >