Search Results

Search found 4900 results on 196 pages for 'upload'.

Page 14/196 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • File uploads and client_max_body_size in nginx + gunicorn + django

    - by carlosescri
    I need to configure nginx + gunicorn to be able to upload files greater than the default max size in both servers. My nginx .conf file looks like this: server { # ... location / { proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_connect_timeout 60; proxy_pass http://localhost:8000/; } } The idea is to allow requests of 20M for two locations: /admin/path/to/upload?param=value /installer/other/path/to/upload?param=value I've tried to add location directives at the same level than the one I've pasted here (getting 404 errors) and also tried to add them inside the location / directive (getting 413 Entity Too Large errors). My location directives look like these in their simplest form: location /admin/path/to/upload/ { client_max_body_size 20M; } location /installer/other/path/to/upload/ { client_max_body_size 20M; } But they don't work (actually I tested lots of combinations and I'm desperate thinking about this. Please, help If you can: What settings do I need to set to make this work? Thank you so much!

    Read the article

  • Upload Picture File Paths to Database Without Creating Multiple Records and Giving The Files Random Names

    - by user1830990
    I want to be able upload pictures to a folder and their filepaths to a MySQL database without creating multiple records. For example instead of: id PicturePath size 1 file1.jpg 90832 2 file2.jpg 84593 I want to do: id PicturePath1 PicturePath2 PicturePath3 1 file1.jpg file3.jpg file5.jpg And also as it uploads, it should change the name of the original file e.g. if User uploads DSC0009.jpg it should upload into the file upload folder and MySQL Database as: someRandomFileName8087935.jpg

    Read the article

  • Upload large files in .NET

    - by Austin
    I've done a good bit of research to find an upload component for .NET that I can use to upload large files, has a progress bar, and can resume the upload of large files. I've come across some components like AjaxUploader, SlickUpload, and PowUpload, to name a few. Each of these options cost money and only PowUpload does the resumable upload, but it does it with a java applet. I'm willing to pay for a component that does those things well, but if I could write it myself that would be best. I have two questions: Is it possible to resume a file upload on the client without using flash/java/Silverlight? Does anyone have some code or a link to an article that explains how to write a .NET HTTPHandler that will allow streaming upload and an ajax progress bar? Thank you, Austin [Edit] I realized I do need to be able to do resumable file uploads for my project, any suggestions for components that can do that?

    Read the article

  • File Upload multiple files in asp.net (similar to gmail)

    - by superstar
    Hi Guys, I need suggestions with regards to the multiple file upload using File Upload control in asp.net(along with C#). I have a File Upload Control, so i click the 'Browse' button and when i select a file from the select file dialog, i want the file to be shown as a link below the File Upload Control( somewhat similar to gmail). This file should be seen such a way that it can be deleted, if i wanted to. And also i should be able to upload another file from the File Upload control. All these files should be uploaded to a location when i use a button click event in the end. I think i have made myself clear. Any Suggestions are really helpful. Thanks.

    Read the article

  • Form validation with optional File Upload field callback

    - by MotiveKyle
    I have a form with some input fields and a file upload field in the same form. I am trying to include a callback into the form validation to check for file upload errors. Here is the controller for adding and the callback: public function add() { if ($this->ion_auth->logged_in()): //validate form input $this->form_validation->set_rules('title', 'title', 'trim|required|max_length[66]|min_length[2]'); // link url $this->form_validation->set_rules('link', 'link', 'trim|required|max_length[255]|min_length[2]'); // optional content $this->form_validation->set_rules('content', 'content', 'trim|min_length[2]'); $this->form_validation->set_rules('userfile', 'image', 'callback_validate_upload'); $this->form_validation->set_error_delimiters('<small class="error">', '</small>'); // if form was submitted, process form if ($this->form_validation->run()) { // add pin $pin_id = $this->pin_model->create(); $slug = strtolower(url_title($this->input->post('title'), TRUE)); // path to pin folder $file_path = './uploads/' . $pin_id . '/'; // if folder doesn't exist, create it if (!is_dir($file_path)) { mkdir($file_path); } // file upload config variables $config['upload_path'] = $file_path; $config['allowed_types'] = 'jpg|png'; $config['max_size'] = '2048'; $config['max_width'] = '1920'; $config['max_height'] = '1080'; $config['encrypt_name'] = TRUE; $this->load->library('upload', $config); // upload image file if ($this->upload->do_upload()) { $this->load->model('file_model'); $image_id = $this->file_model->insert_image_to_db($pin_id); $this->file_model->add_image_id_to_pin($pin_id, $image_id); } } // build page else: // User not logged in redirect("login", 'refresh'); endif; } The callback: function validate_upload() { if ($_FILES AND $_FILES['userfile']['name']): if ($this->upload->do_upload()): return true; else: $this->form_validation->set_message('validate_upload', $this->upload->display_errors()); return false; endif; else: return true; endif; } I am getting the error Fatal error: Call to a member function do_upload() on a non-object on line 92 when I try to run this. Line 92 is the if ($this->upload->do_upload()): line in the validate_upload callback. Am I going about this the right way? What's triggering this error?

    Read the article

  • $_FILES empty on image upload

    - by zvir
    i need help, i'm programing some kind of catalogue and i have a page where clients can upload their logo or images. every page i make is included in index.php and my url looks like something like this www.url.com/index.php?s=upload where "upload" is name of upload.php file. when i create form on that upload.php file and submit it, $_FILES array is empty. echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"index.php\" />\n"; echo "<input type=\"file\" name=\"image\">\n"; echo "<input type=\"hidden\" name=\"s\" value=\"upload\">\n"; echo "<input type=\"submit\" name=\"submit\" value=\"Spremi\">\n"; echo "</form>\n"; i tried everything and nothing works. $_POST items are returned but $_FILES are empty...

    Read the article

  • Django Image Upload: IOErrno2 Could not find path -- and yet it's saving the image there anyway?

    - by Rob
    I have an issue where the local version of django is handling image upload as expected but my server is not. Note: I am using a Django Container on MediaTemple.net (grid server) Here is my code. def view_settings(request): <snip> if request.POST: success_msgs = () mForm = MainProfileForm(request.POST, request.FILES, instance = mProfile) pForm = ChangePasswordForm(request.POST) eForm = ChangeEmailForm(request.POST) if mForm.is_valid(): m = mForm.save(commit = False) if mForm.cleaned_data['avatar']: m.avatar = upload_photo(request.FILES['avatar'], settings.AVATAR_SAVE_LOCATION) m.save() success_msgs += ('profile pictured updated',) <snip> def upload_photo(data,saveLocation): savePath = os.path.join(settings.MEDIA_ROOT, saveLocation, data.name) destination = open(savePath, 'wb+') for chunk in data.chunks(): destination.write(chunk) destination.close() return os.path.join(saveLocation, data.name) Here's where it gets whacky and I was hoping someone could shed a light on this error, because either a) it's the wrong error code, or b) something is happening with the file before it's completely handled. To recap, the file was actually uploaded to the server in the intended directory - and yet this err msg continues to persist. IOError at /user/settings [Errno 2] No such file or directory: u'/home/user66666/domains/example.com/html/media/images/avatars/DSC03852.JPG' Environment: Request Method: POST Request URL: http://111.111.111.111:2011/user/settings Django Version: 1.0.2 final Python Version: 2.4.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'ctrlme', 'usertools', 'easy_thumbnails'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Traceback: File "/home/user6666/containers/django/leonidas/usertools/views.py" in view_settings m.avatar = upload_photo(request.FILES['avatar'], settings.AVATAR_SAVE_LOCATION) File "/home/user666666/containers/django/leonidas/usertools/functions.py" in upload_photo destination = open(savePath, 'wb+')

    Read the article

  • PHP Uploadprogress extension function always returning null, with no upload data.

    - by abhinavlal
    I am using php 5.3.2 with uploadprogress extension to get a progressbar during upload using zend framework. Even the demo provided with zend is not working. code in zend example - if (isset($_GET['uploadId'])) { set_include_path(realpath(dirname(__FILE__) . '/../../../library') . PATH_SEPARATOR . get_include_path()); require_once 'Zend/ProgressBar.php'; require_once 'Zend/ProgressBar/Adapter/JsPull.php'; require_once 'Zend/Session/Namespace.php'; $data = uploadprogress_get_info($_GET['uploadId']); $bytesTotal = ($data === null ? 0 : $data['bytes_total']); $bytesUploaded = ($data === null ? 0 : $data['bytes_uploaded']); $adapter = new Zend_ProgressBar_Adapter_JsPull(); $progressBar = new Zend_ProgressBar($adapter, 0, $bytesTotal, 'uploadProgress'); if ($bytesTotal === $bytesUploaded) { $progressBar->finish(); } else { $progressBar->update($bytesUploaded); } } uploadprogress_get_info always returns null. I thought something is wrong with my code so i downloaded the working sample available at http://labs.liip.ch/uploadprogresssimple/index.php but even in that case in uploadprogress_get_info always return null. My uploadprogress config values uploadprogress support enabled Version 1.0.1 uploadprogress.file.contents_template /tmp/upload_contents_%s uploadprogress.file.filename_template /tmp/upt_%s.txt uploadprogress.get_contents 1 While googling around i found uploadprogress extension has some issue with Suhosin Patch < 0.9.26 but i am using Suhosin Patch 0.9.9.1

    Read the article

  • Stupid Geek Tricks: Use Google Chrome Drag/Drop to Upload Files Easier

    - by The Geek
    There’s nothing more annoying than saving a file somewhere on your hard drive, and then having to browse for that file again when you’re trying to upload it somewhere on the web. Thankfully Google Chrome makes this process much easier. Note: this might potentially work in Firefox 4, but we didn’t take the time to test it out. It definitely doesn’t work in Firefox 3.6 or Internet Explorer Latest Features How-To Geek ETC The How-To Geek Holiday Gift Guide (Geeky Stuff We Like) LCD? LED? Plasma? The How-To Geek Guide to HDTV Technology The How-To Geek Guide to Learning Photoshop, Part 8: Filters Improve Digital Photography by Calibrating Your Monitor Our Favorite Tech: What We’re Thankful For at How-To Geek The How-To Geek Guide to Learning Photoshop, Part 7: Design and Typography Happy Snow Bears Theme for Chrome and Iron [Holiday] Download Full Command and Conquer: Tiberian Sun Game for Free Scorched Cometary Planet Wallpaper Quick Fix: Add the RSS Button Back to the Firefox Awesome Bar Dropbox Desktop Client 1.0.0 RC for Windows, Linux, and Mac Released Hang in There Scrat! – Ice Age Wallpaper

    Read the article

  • Custom Upload Advanced Scripting CMS

    - by bradlis7
    I am looking for a specific content management platform that would display themes for my application. Requirements are as folllows: Any user can upload content, but has to be approved by an administrator When the user uploads the content, an external application is called to generate a thumbnail I could create this using codeigniter or something, but I would much prefer to use an existing system. I have experience with Drupal (seems a little bloated for my needs), and Wordpress (I'm using it as main website right now). Maybe I need a plugin for WordPress instead of another CMS. WordPress currently blocks uploads of my file type. I can modify it, but it's a pain to update it every time WordPress has a new release.

    Read the article

  • Upload Recordings Of The Problem To Your SR

    - by bseckin
    Do you find yourself trying several times to explain a problem in a Service Request? Does the support engineer ask more than once for clarification? If so, you might be interested in DITO -- Demo It To Oracle. DITO uses CamStudio (free download!) to record the exact nature of the problem, and upload the output to your SR. The following articles provide more details: Working with Support - MOSSOS (Doc ID 1265130.1) "Demo It To Oracle" (DITO) - CamStudio Help (Doc ID 11.1) Why take up valuable time first explaining the problem, then trying to get a web conference setup to show exactly what is going on? The next time you file an SR, try including a recording showing exactly which application is failing, where it is failing, and what it looks like when it fails.

    Read the article

  • My user can't upload files to folders owned by www-data

    - by Thomas Gautvedt
    I think I have screwed up my permissions in Ubuntu. I am using my server to run PHP. I recently ran across a problem where PHP could not create directories in the var/www-directory, so I searched around on the internet. Now PHP can write and access anything like it should, but as a user, I can't create new folders or files anymore. Right now, the permissions for folders are like this: drwxrwsr-x 2 www-data www-data [Folders] This is the permissions when I upload using sftp: -rw-rw-r-- 1 gautvedt www-data [Folders] What have I done wrong and how can I change this?

    Read the article

  • Upload Recordings Of The Problem To Your SR

    - by jhpierce
    Do you find yourself trying several times to explain a problem in a Service Request? Does the support engineer ask more than once for clarification? If so, you might be interested in DITO -- Demo It To Oracle. DITO uses CamStudio (free download!) to record the exact nature of the problem, and upload the output to your SR. The following articles provide more details: Working with Support - MOSSOS (Doc ID 1265130.1) "Demo It To Oracle" (DITO) - CamStudio Help ( Doc ID 11.1) Why take up valuable time first explaining the problem, then trying to get a web conference setup to show exactly what is going on? The next time you file an SR, try including a recording showing exactly which application is failing, where it is failing, and what it looks like when it fails.

    Read the article

  • Upload Recordings Of The Problem To Your SR

    - by Irina
    Do you find yourself trying several times to explain a problem in a Service Request? Does the support engineer ask more than once for clarification? If so, you might be interested in DITO -- Demo It To Oracle. DITO uses CamStudio (free download!) to record the exact nature of the problem, and upload the output to your SR. The following articles provide more details: Working with Support - MOSSOS (Doc ID 1265130.1) "Demo It To Oracle" (DITO) - CamStudio Help ( Doc ID 11.1) Why take up valuable time first explaining the problem, then trying to get a web conference setup to show exactly what is going on? The next time you file an SR, try including a recording showing exactly which application is failing, where it is failing, and what it looks like when it fails.

    Read the article

  • How to validate presence of an uploaded file in rails?

    - by brad
    I'm playing around creating a rails file uploader and have struck a problem that should have an obvious solution. How do I check that a file has been selected in my form and uploaded? Here is my new.html.erb view <h2>Upload File</h2> <% form_for(@upload_file, :url => {:action => 'save'}, :html => {:multipart => true}) do |f| %> <%= f.error_messages %> <p> <%= f.label :file -%> <%= f.file_field :upload -%> </p> <p> <%= f.label :description %> <%= f.text_field :description %> </p> <p> <%= f.label :file_type %> <%= f.select :file_type, ["XML Data"] %> </p> <p><%= f.submit 'Upload File' %></p> <% end %> and here is my upload_file.rb model class UploadFile < ActiveRecord::Base validates_presence_of :description validates_presence_of :file_type validates_presence_of :upload def upload=(upload_file_field) self.name = "#{Time.now.strftime("%Y%m%d%H%M%S")}_#{upload_file_field.original_filename}" File.open("#{RAILS_ROOT}/public/upload/#{self.name}", "wb") { |f| f.write(upload_file_field.read) } end end If I use this as shown here, the validation validates_presence_of :upload always fails and I am returned to my form with an error message. I'd be very grateful if someone could explain how to do this validation correctly, and I'd be even more grateful if they could explain why it works. Thanks.

    Read the article

  • how to set Content-Type automatically when i download the data that i uploaded.

    - by zjm1126
    this is my code : import os from google.appengine.ext import webapp from google.appengine.ext.webapp import template from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext import db #from login import htmlPrefix,get_current_user class MyModel(db.Model): blob = db.BlobProperty() class BaseRequestHandler(webapp.RequestHandler): def render_template(self, filename, template_args=None): if not template_args: template_args = {} path = os.path.join(os.path.dirname(__file__), 'templates', filename) self.response.out.write(template.render(path, template_args)) class upload(BaseRequestHandler): def get(self): self.render_template('index.html',) def post(self): file=self.request.get('file') obj = MyModel() obj.blob = db.Blob(file.encode('utf8')) obj.put() self.response.out.write('upload ok') class download(BaseRequestHandler): def get(self): #id=self.request.get('id') o = MyModel.all().get() #self.response.out.write(''.join('%s: %s <br/>' % (a, getattr(o, a)) for a in dir(o))) self.response.out.write(o) application = webapp.WSGIApplication( [ ('/?', upload), ('/download',download), ], debug=True ) def main(): run_wsgi_app(application) if __name__ == "__main__": main() my index.html is : <form action="/" method="post"> <input type="file" name="file" /> <input type="submit" /> </form> and it show : <__main__.MyModel object at 0x02506830> but ,i don't want to see this , i want to download it , how to change my code to run, thanks updated it is ok now : class upload(BaseRequestHandler): def get(self): self.render_template('index.html',) def post(self): file=self.request.get('file') obj = MyModel() obj.blob = db.Blob(file) obj.put() self.response.out.write('upload ok') class download(BaseRequestHandler): def get(self): #id=self.request.get('id') o = MyModel.all().order('-').get() #self.response.out.write(''.join('%s: %s <br/>' % (a, getattr(o, a)) for a in dir(o))) self.response.headers['Content-Type'] = "image/png" self.response.out.write(o.blob) and new question is : if you upload a 'png' file ,it will show successful , but ,when i upload a rar file ,i will run error , so how to set Content-Type automatically , and what is the Content-Type of the 'rar' file thanks

    Read the article

  • Can't upload project to PPA using Quickly

    - by RobinJ
    I can't get Quickly to upload my project into my PPA. I've set up my PGP key and used it so sign the code of conduct, and the PPA exists. I don't know what other usefull information I can supply. robin@RobinJ:~/Ubuntu One/Python/gtkreddit$ quickly share --ppa robinj/gtkredditGet Launchpad Settings Launchpad connection is ok gpg: WARNING: unsafe permissions on configuration file `/home/robin/.gnupg/gpg.conf' gpg: WARNING: unsafe enclosing directory permissions on configuration file `/home/robin/.gnupg/gpg.conf' gpg: WARNING: unsafe permissions on configuration file `/home/robin/.gnupg/gpg.conf' gpg: WARNING: unsafe enclosing directory permissions on configuration file `/home/robin/.gnupg/gpg.conf' Traceback (most recent call last): File "/usr/share/quickly/templates/ubuntu-application/share.py", line 138, in <module> license.licensing() File "/usr/share/quickly/templates/ubuntu-application/license.py", line 284, in licensing {'translatable': 'yes'}) File "/usr/share/quickly/templates/ubuntu-application/internal/quicklyutils.py", line 166, in change_xml_elem xml_tree.find(parent_node).insert(0, new_node) AttributeError: 'NoneType' object has no attribute 'insert' ERROR: share command failed Aborting I reported this as a bug on Launchpad, because I assume that it is a bug. If you know a quick workaround, please let me know. https://bugs.launchpad.net/ubuntu/+source/quickly/+bug/1018138

    Read the article

  • How to Upload Really Large Files to SkyDrive, Dropbox, or Email

    - by Matthew Guay
    Do you need to upload a very large file to store online or email to a friend? Unfortunately, whether you’re emailing a file or using online storage sites like SkyDrive, there’s a limit on the size of files you can use. Here’s how to get around the limits. Skydrive only lets you add files up to 50 MB, and while the Dropbox desktop client lets you add really large files, the web interface has a 300 MB limit, so if you were on another PC and wanted to add giant files to your Dropbox, you’d need to split them. This same technique also works for any file sharing service—even if you were sending files through email. There’s two ways that you can get around the limits—first, by just compressing the files if you’re close to the limit, but the second and more interesting way is to split up the files into smaller chunks. Keep reading for how to do both. Latest Features How-To Geek ETC The How-To Geek Guide to Learning Photoshop, Part 8: Filters Get the Complete Android Guide eBook for Only 99 Cents [Update: Expired] Improve Digital Photography by Calibrating Your Monitor The How-To Geek Guide to Learning Photoshop, Part 7: Design and Typography How to Choose What to Back Up on Your Linux Home Server How To Harmonize Your Dual-Boot Setup for Windows and Ubuntu Hang in There Scrat! – Ice Age Wallpaper How Do You Know When You’ve Passed Geek and Headed to Nerd? On The Tip – A Lamborghini Theme for Chrome and Iron What if Wile E. Coyote and the Road Runner were Human? [Video] Peaceful Winter Cabin Wallpaper Store Tabs for Later Viewing in Opera with Tab Vault

    Read the article

  • You Can&rsquo;t Upload An Empty File To SharePoint 2007 Or SharePoint 2010

    - by Brian Jackett
    The title of this post is pretty self explanatory, but I thought it worth mentioning since I had never run across this rule until just recently.  A few weeks ago I was testing out a new workflow attached to a SharePoint 2007 document library.  I uploaded various file types to ensure all were handled properly.  One of the files I happened to test with was an empty .txt file to which I got the following error.      As you can see from the error message you aren’t allowed to upload a file that is empty.  Fast forward to this week when I was doing some research for my upcoming SharePoint 2010 beta exams.  I remembered that error I got a few weeks ago and decided to try out with SharePoint 2010 as well.  No surprises I got a similar error. Conclusion     Next time you are uploading files to a SharePoint 2007 or 2010 document library, make sure the file is not empty.  Coincidentally when I tweeted about this issue a few friends replied that they had also found this error recently.  I don’t know the internal reasoning why this is prevented but I assume it has something to do with how the blob for the file is stored in the database.  I assume that this would still be the case even if you had Remote Blob Storage (RBS) configured for your farm, but don’t have access to such a farm to confirm.  If anyone reading this does have access and wants to confirm that would be appreciated, just leave a comment.         -Frog Out

    Read the article

  • Web Application : How to upload multiple images at a time

    - by SAMIR BHOGAYTA
    //First add image control into the web form how many you want to upload images at a time //Add one button //Write the below code into the button_click event if (FileUpload1.HasFile) { string imagefile = FileUpload1.FileName; if (CheckFileType(imagefile) == true) { Random rndob = new Random(); int db = rndob.Next(1, 100); filename = System.IO.Path.GetFileNameWithoutExtension(imagefile) + db.ToString() + System.IO.Path.GetExtension(imagefile); String FilePath = "images/" + filename; FileUpload1.SaveAs(Server.MapPath(FilePath)); objimg.ImageName = filename; Image1(); if (Session["imagecount"].ToString() == "1") { Img1.ImageUrl = FilePath; ViewState["img1"] = FilePath; } else if (Session["imagecount"].ToString() == "2") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = FilePath; ViewState["img2"] = FilePath; } else if (Session["imagecount"].ToString() == "3") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = ViewState["img2"].ToString(); Img3.ImageUrl = FilePath; ViewState["img3"] = FilePath; } else if (Session["imagecount"].ToString() == "4") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = ViewState["img2"].ToString(); Img3.ImageUrl = ViewState["img3"].ToString(); Img4.ImageUrl = FilePath; ViewState["img4"] = FilePath; } else if (Session["imagecount"].ToString() == "5") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = ViewState["img2"].ToString(); Img3.ImageUrl = ViewState["img3"].ToString(); Img4.ImageUrl = ViewState["img4"].ToString(); Img5.ImageUrl = FilePath; ViewState["img5"] = FilePath; } } } //execption handling else { lblErrMsg.Visible = true; lblErrMsg.Text = ""; lblErrMsg.Text = "please select a file"; } } //if file extension belongs to these list then only allowed public bool CheckFileType(string filename) { string ext; ext = System.IO.Path.GetExtension(filename); switch (ext.ToLower()) { case ".gif": return true; case ".jpeg": return true; case ".jpg": return true; case ".bmp": return true; case ".png": return true; default: return false; } }

    Read the article

  • Unauthorized response from Server with API upload

    - by Ethan Shafer
    I'm writing a library in C# to help me develop a Windows application. The library uses the Ubuntu One API. I am able to authenticate and can even make requests to get the Quota (access to Account Admin API) and Volumes (so I know I have access to the Files API at least) Here's what I have as my Upload code: public static void UploadFile(string filename, string filepath) { FileStream file = File.OpenRead(filepath); byte[] bytes = new byte[file.Length]; file.Read(bytes, 0, (int)file.Length); RestClient client = UbuntuOneClients.FilesClient(); RestRequest request = UbuntuOneRequests.BaseRequest(Method.PUT); request.Resource = "/content/~/Ubuntu One/" + filename; request.AddHeader("Content-Length", bytes.Length.ToString()); request.AddParameter("body", bytes, ParameterType.RequestBody); client.ExecuteAsync(request, webResponse => UploadComplete(webResponse)); } Every time I send the request I get an "Unauthorized" response from the server. For now the "/content/~/Ubuntu One/" is hardcoded, but I checked and it is the location of my root volume. Is there anything that I'm missing? UbuntuOneClients.FilesClient() starts the url with "https://files.one.ubuntu.com" UbuntuOneRequests.BaseRequest(Method.{}) is the same requests that I use to send my Quota and Volumes requests, basically just provides all of the parameters needed to authenticate. EDIT:: Here's the BaseRequest() method: public static RestRequest BaseRequest(Method method) { RestRequest request = new RestRequest(method); request.OnBeforeDeserialization = resp => { resp.ContentType = "application/json"; }; request.AddParameter("realm", ""); request.AddParameter("oauth_version", "1.0"); request.AddParameter("oauth_nonce", Guid.NewGuid().ToString()); request.AddParameter("oauth_timestamp", DateTime.Now.ToString()); request.AddParameter("oauth_consumer_key", UbuntuOneRefreshInfo.UbuntuOneInfo.ConsumerKey); request.AddParameter("oauth_token", UbuntuOneRefreshInfo.UbuntuOneInfo.Token); request.AddParameter("oauth_signature_method", "PLAINTEXT"); request.AddParameter("oauth_signature", UbuntuOneRefreshInfo.UbuntuOneInfo.Signature); //request.AddParameter("method", method.ToString()); return request; } and the FilesClient() method: public static RestClient FilesClient() { return (new RestClient("https://files.one.ubuntu.com")); }

    Read the article

  • Codeigniter not returning me to upload form after image upload.

    - by Drew
    I'm still very new to codeigniter. The issue i'm having is that the file uploads fine and it writes to the database without issue but it just doesn't return me to the upload form. Instead it stays in the do_upload and doesn't display anything. Even more bizarrely there is some source code behind the scenes. Can someone tell my what it is i'm doing wrong because I want to be returning to my upload form after submission. Thanks in advance. Below is my code: Controller: function do_upload() { if($this->Upload_model->do_upload()) { $this->load->view('home/upload_form'); }else{ $this->load->view('home/upload_success', $error); } } Model: function do_upload() { $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '2000'; $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); return $error; } else { $data = $this->upload->data(); $full_path = 'uploads/' . $data['file_name']; $spam = array( 'image_url' => $full_path, 'url' => $this->input->post('url') ); $id = $this->input->post('id'); $this->db->where('id', $id); $this->db->update('NavItemData', $spam); return true; } } View (called upload_form): <html> <head> <title>Upload Form</title> </head> <body> <?php if(isset($buttons)) : foreach($buttons as $row) : ?> <h2><?php echo $row->image_url; ?></h2> <p><?php echo $row->url; ?></p> <p><?php echo $row->name; ?></p> <p><?php echo anchor("upload/update_nav/$row->id", 'edit'); ?></p> <?php endforeach; ?> <?php endif; ?> </body> </html>

    Read the article

  • FTP Upload multiple files without disconnect using .NET

    - by DK39
    I'm uploading multiple files using FtpWebRequest. But for every file I'm opening and closing a connection. How can I upload multiple files using the same connection? Like a ftp client application, connect using username and password, change directory, upload file1, upload file2, upload file3, disconnect.

    Read the article

  • Form data upload from iPhone to PHP server via https

    - by Horace Ho
    Is there a good tutorial or sample project of how to upload data from iPhone to a self-owned web server? The project is like: A survey application on iPhone which stores the user input data in a plist When there is internet connection, the program will enable an "Upload" button When the Upload button is clicked, the program will upload the data via HTTP form submit (POST) The server is Linux + MySQL + Apache + PHP The data should be sent via a https:// connection

    Read the article

  • How to know when an upload is done?

    - by mr1031011
    I'm using Guzzle 4 (latest version) to upload file to a remote server, since it uses stream to upload the $response-getStatusCode() will be 100 which means "Continue" and the responseBody is not available at this point. Is there a way to catch the remote server response when the upload is done? Edit 1: I was able to call back to a function when the upload is done using this: https://github.com/guzzle/progress-subscriber However, I haven't found out how to get the response yet

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >