Search Results

Search found 22501 results on 901 pages for 'form upload'.

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

  • how to download data which upload to gae ,

    - 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

    Read the article

  • Resumable Upload in Ruby on Rails

    - by user253011
    Hi, I have been searching for a way for resumable file upload in RoR. In conclusion, I found out other than Java Applet no client-side-and-cross-platform agent can access the file system in such a way that to request the file from the position where the upload got terminated (due to any reason) with some exceptions like http://github.com/taf2/resume-up/tree/master (built in native Ruby, but requires google gears which is not "reliable" yet when it comes to cross platform almost same story as of ActiveX!) Since the only reliable option left is java applet, is there any good tutorial/forum/documentation for those paid java applets, such as "thin slice upload" etc. to make it work with rails application. I have found one http : // github . com / dassi / mediaclue , its a non-multi-ligual-German-Application in which they used jumploader. But in that application, I am unable to see resumable functionality. Scratching my head against their documentation, i found out http : // jumploader.com / doc_resume.html It tells that jumploader has resume functionality in Cross session resume, the one i am looking for (if the user close the browser the new session gets hold on uncompleted uploaded files from the old session against the user id). But I cant find any example on their demos page which actually pause/RESUME functionality in a continuous manner! Is it even possible to achieve that kind of resumable functionality. Please tell me about any options/example/demos preferable deployed in rails. I shall be very much obliged. ~ Thanks

    Read the article

  • JQuery how to resubmit form after ajax call success

    - by Steven Rosato
    I am using JQuery to perform form submission through an ajax request. I use form.submit(function() { if( success ) { return true; } validate(); //proceeds to an ajax call return false; } On request success I want to either proceed with form submission or user callback. Therefore, if the user callback is undefined, I will submit the form on form validation success (from my validate function). config = { successCallback: function() { success = true; form.submit(); //does not work } }; validate = function() { $.ajax( ... success: function(data) { //code logic config.successCallback(); } ); }; The ajax success callback will call config.successCallback() and if it was never overridden by the user, it would proceed to normal form submission. I tried using an instance variable (success) to make sure 'return true' would proceed to default form submission. Unfortunately this is not working. It seems that the 'return false' statement that prevents default form submission will neglect any further submit calls even if an instance variable was set. It only works after clicking the submit button another time (that makes it twice for it to work). Is there any workaround for this. I want to both use a user callback when provided but proceed with default form submission when not, and since I am using an ajax function to validate the form, the ajax success callback is complicating things.

    Read the article

  • JavaScript To Clear Form Field On Submit Before Form Submission To Perl Script

    - by Russell C.
    We have a very long form that has a number of fields and 2 different submit buttons. When a user clicks the 1st submit button ("Photo Search") the form should POST and our script will do a search for matching photos based on what the user entered in the text input ("photo_search_text") next to the 1st submit button and reload the entire form with matching photos added to the form. Upon clicking the 2nd submit button ("Save Changes") at the end of the form, it should POST and our script should update the database with the information the user entered in the form. Unfortunately the layout of the form makes it impossible to separate it into 2 separate forms. I checked the entire form POST and unfortunately the submitted fields are identical to the perl script processing the form submission no matter which submit button is clicked so the perl script can't differentiate which action to perform based on which submit button is pushed. The only thing I can think of is to update the onclick action of the 2nd submit button so it clears the "photo_search_text" field before the form is submitted and then only perform a photo search if that fields has a value. Based on all this, my question is what does the JavaScript look that could clear out the "photo_search_text" field when someone clicks on the 2nd submit button? Here is what I've tried so far none of which has worked successfully: <input type="submit" name="submit" onclick="document.update-form.photo_search_text.value='';" value="Save Changes"> <input type="submit" name="submit" onsubmit="document.update-form.photo_search_text.value='';" value="Save Changes"> <input type="submit" name="submit" onclick="document.getElementById('photo_search_text')='';" value="Save Changes"> We also use JQuery on the site so if there is a way to do this with jQuery instead of plain JavaScript feel free to provide example code for that instead. Lastly, if there is another way to handle this that I'm not thinking of any and all suggestions would be welcome. Thanks in advance for your help!

    Read the article

  • Zend file upload error

    - by jgnasser
    I am attempting to upload a file using Zend Framework 1.8 and I get some errors. Here is the code snippet: The form element: $element = new Zend_Form_Element_File('doc'); $element->setLabel('Upload an image:') ->setDestination('/path/to/my/upload/folder'); $element->addValidator('Count', false, 1); $element->addValidator('Size', false, 102400); $element->addValidator('Extension', false, 'jpg,png,gif,doc,docx,xls,xlsx,txt'); $this->addElement($element); The code for handling the upload: $adapter = new Zend_File_Transfer_Adapter_Http(); if (!$adapter->receive()) { $messages = $adapter->getMessages(); echo implode("\n", $messages); } This works fine and the file is uploaded but I get the error "The file 'doc' was illegal uploaded, possible attack". I managed to get past this problem by not creating a new Zend_File_Transfer_Adapter_Http() but instead using: $adapter = $form->doc->getTransferAdapter(); With this modification, the first error disappears but now I have an error saying I have provided 2 files instead of one (probably its reading the temp) and when I adjust the validator to accept two files I then get the arror saying "The file 'doc' was not found" and the upload now fails completely. Please help

    Read the article

  • error handler isn't called when file is uploaded via ajax using jQuery form plugin

    - by scompt.com
    Here's my test case. If the form is posted, a 500 error response is sent. If not, the form is sent. If the file input tag is commented out, the error handler is called. If the file input tag is present, the error handler isn't called. I think this might have something to do with the fact that jQuery needs to use an iframe to handle the upload and iframes don't seem to respond to the error handler. Edit: If I add iframe: true to the options passed to ajaxSubmit to force the use of an iframe, the non-file-upload case stops working also, so it definitely has to do with the iframe. Edit2: I'm using the jQuery Form Plugin. <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { header('HTTP/1.1 500 Internal Server Error'); die; } else {?> <html><head> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=2.9.2'></script> <script type='text/javascript' src='http://github.com/malsup/form/raw/master/jquery.form.js?v2.43'></script> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('a').click(function() {jQuery('form').ajaxSubmit({error: function(){alert('error handler called');}})}); }); </script> </head><body> <form method="POST"> <input type="text" name="mytext" /> <input type="file" name="myfile" /><!-- comment this element out --> <input type="hidden" name="blah" value="blah" /> <a>submit</a> </form> </body></html> <?php } Is there any way to get the error handler to be called in both situations?

    Read the article

  • Can I make any ASP.NET/HTML element into form-data that posts back to the server?

    - by Giffyguy
    I am using Javascript to alter the innerHTML attribute of a <td> and I need to get that info back in the form submittal. The <td> corrosponds to an <asp:TableCell> on the server-side, where the Text attribute is set to an initial value. The user cannot enter the value in this particular field. Instead, its value is set by me (via client-side script) based on actions that the user performs. But this field is useless to me if I can't see its value on the server-side as well. I'd like to avoid using a read-only textbox, because those are difficult to resize dynamically. Can an <asp:Label> be used as form data? Is there any way to achive this without letting the user manually enter the data? Or is there a simpler way to store a string as a variable somewhere and send it back as form-data?

    Read the article

  • How to upload Image on Android?

    - by Mattiah85
    I havve to upload image from my SD card to PHP server. I have read a lot of articles and topics but I have some problems... First I have use that code: HttpURLConnection connection = null; DataOutputStream outputStream = null; //DataInputStream inputStream = null; String urlServer = hostName+"Upload"; String lineEnd = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; String serverResponseMessage; //int serverResponseCode; int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; try { showLog("uploading file: " + file); FileInputStream fileInputStream = new FileInputStream(new File(pictureFileDir+"/"+file) ); URL url = new URL(urlServer); connection = (HttpURLConnection) url.openConnection(); // Allow Inputs &amp; Outputs. connection.setDoInput(true); connection.setDoOutput(true); connection.setUseCaches(false); // Set HTTP method to POST. connection.setRequestMethod("POST"); connection.setRequestProperty("Connection", "Keep-Alive"); connection.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary); outputStream = new DataOutputStream( connection.getOutputStream() ); outputStream.writeBytes(twoHyphens + boundary + lineEnd); outputStream.writeBytes("Content-Disposition: form-data; name=\"uploaded_file\";filename=\"" + file +"\"" + lineEnd); outputStream.writeBytes(lineEnd); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); buffer = new byte[bufferSize]; // Read file bytesRead = fileInputStream.read(buffer, 0, bufferSize); while (bytesRead > 0) { outputStream.write(buffer, 0, bufferSize); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); bytesRead = fileInputStream.read(buffer, 0, bufferSize); } outputStream.writeBytes(lineEnd); outputStream.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); // Responses from the server (code and message) //serverResponseCode = connection.getResponseCode(); serverResponseMessage = connection.getResponseMessage(); showLog("server response: " + serverResponseMessage); fileInputStream.close(); outputStream.flush(); outputStream.close(); } catch (Exception ex) { ex.printStackTrace(); } but server response 200/OK and no file was on destination server... After i have read about Multipart: try { HttpParams params = new BasicHttpParams(); params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); DefaultHttpClient mHttpClient = new DefaultHttpClient(params); File image = new File(pictureFileDir + "/" + filename); HttpPost httppost = new HttpPost(hostName+"Upload"); MultipartEntity multipartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); multipartEntity.addPart("Image", new FileBody(image)); httppost.setEntity(multipartEntity); mHttpClient.execute(httppost, new PhotoUploadResponseHandler()); } catch (Exception e) { e.printStackTrace(); } but then a i have such LOG in LogCat and nothing else... 06-04 06:50:52.277: D/dalvikvm(1584): DexOpt: couldn't find static field Lorg/apache/http/message/BasicHeaderValueParser;.INSTANCE 06-04 06:50:52.277: W/dalvikvm(1584): VFY: unable to resolve static field 6688 (INSTANCE) in Lorg/apache/http/message/BasicHeaderValueParser; 06-04 06:50:52.277: D/dalvikvm(1584): VFY: replacing opcode 0x62 at 0x001b ServerSide Script: $target_path = "uploads"; $target_path = $target_path . basename( $_FILES['Image']); if(move_uploaded_file($_FILES['tmp_name'], $file_path)) { echo "success"; } else{ echo "fail"; } why? What is the simplest way to upload image?

    Read the article

  • Post valuse and upload Image to php server in android

    - by lawat
    I am trying to upload image from android phone to php server with additional values,the method is post my php file look like this if($_POST['val1']){ if($_POST['val2']){ if($_FILE['image']){ ...... } } }else{ echo "Value not found"; } I am doing is URL url=new URL("http://www/......../myfile.php"); HttpURLConnection con=(HttpURLConnection) url.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setRequestMethod("POST");//Enable http POST con.setRequestProperty("Connection", "Keep-Alive"); con.setRequestProperty("Content-Type", "multipart/form-data;boundary="+"****"); connection.setRequestProperty("uploaded_file", imagefilePath); DataOutputStream ostream = new DataOutputStream( con.getOutputStream()); String res=("Content-Disposition: form-data; name=\"val1\""+val1+"****"+ "Content-Disposition: form-data; name=\"val2\""+val2+"****" "Content-Disposition: form-data; name=\"image\";filename=\"" + imagefilePath +"\""+"****"); outputStream.writeBytes(res); my actual problem is values are not posting so first if condition get false and else section is executed that is it give value not found please help me

    Read the article

  • Retrieving Data From formData in Rails jquery-file-upload

    - by CanCeylan
    I am trying to add additional form data by using https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-form-data this tutorial for jQuery-File-Upload plugin in my Rails app. I'm following the instructions for Setting formData on upload start for each individual file upload. My problem is, after saving the files with their titles as explained in tutorial, I cannot show them in the final table, because I don't know how to reach the formData's values. How should I reach the data inside data.formData = inputs.serializeArray(); and post them next to each item ? Thanks.

    Read the article

  • App-Engine (Java) File Upload

    - by Manjoor
    I managged to upload files on app-engine by using the following example http://stackoverflow.com/questions/1513603/how-to-upload-and-store-an-image-with-google-app-engine-java and http://www.mail-archive.com/[email protected]/msg08090.html The problem is, I am sumitting other fields along with file field as listed below <form action="index.jsp" method="post" enctype="multipart/form-data"> <input name="name" type="text" value=""> <br/> <input name="imageField" type="file" size="30"> <br/> <input name="Submit" type="submit" value="Sumbit"> </form> In my servlet I am getting null when querying name = request.getParameter("name"); Why it is so? Is there a way to retrieve text field value?

    Read the article

  • Form values appear blank when submitting to the database - Drupal FormAPI

    - by GaxZE
    Hello, I have been working on this drupal form API script for past week and half. to give an insight into my problem.. the form below merely lists a host of database records which contain 5 individual scoring ranks. (mind, action, relationship, language and IT). this code is apart of my own custom module where all values are listed from the database. the idea behind this module is to be able to edit these values on a large scale. I am having trouble getting the values entered in the form to be passed to the variables inside of the marli_admin_submit function. the second problem is the assigning those values to their specific ID. for this purpose id like to add im merely trying to get just one score updated rather than all of them. below is my code. any advice appreciated. function marli_scores(){ $result = pager_query(db_rewrite_sql('SELECT * FROM marli WHERE value != " "')); while ($node = db_fetch_object($result)) { $attribute = $node->attribute; $field = $node->field_name; $item = $node->value; $mind = $node->mind; $action = $node->action; $relationship = $node->relationship; $language = $node->language; $it = $node->it; $form['field'][$node->marli_id] = array('#type' => 'markup', '#value' => $field, '#prefix' => '<b>', '#suffix' => '</b>'); $form['title'][$node->marli_id] = array('#type' => 'markup', '#value' => $item, '#prefix' => '<b>', '#suffix' => '</b>'); $form['mind'][$node->marli_id] = array('#type' => 'textfield', '#maxlength' => '1', '#size' => '1', '#value' => $mind); $form['action'][$node->marli_id] = array('#type' => 'textfield', '#maxlength' => '1', '#size' => '1', '#value' => $action); $form['relationship'][$node->marli_id] = array('#type' => 'textfield', '#maxlength' => '1', '#size' => '1', '#value' => $relationship); $form['language'][$node->marli_id] = array('#type' => 'textfield', '#maxlength' => '1', '#size' => '1', '#value' => $language); $form['it'][$node->marli_id] = array('#type' => 'textfield', '#maxlength' => '1', '#size' => '1', '#value' => $it); } $form['pager'] = array('#value' => theme('pager', NULL, 50, 0)); $form['save'] = array('#type' => 'submit', '#value' => t('Save')); $form['#theme'] = 'marli_scores'; return $form; } function marli_admin_submit($form, &$form_state) { $marli_id = 4; $submit_mind = $form_state['values']['mind'][$marli_id]; $submit_action = $form_state['values']['action'][$marli_id]; $submit_relationship = $form_state['values']['relationship'][$marli_id]; $submit_language = $form_state['values']['language'][$marli_id]; $submit_it = $form_state['values']['it'][$marli_id]; $sql_query = "UPDATE {marli} SET mind = %d, action = %d, relationship = %d, language = %d, it = %d WHERE marli_id = %d"; if ($success = db_query($sql_query, $submit_mind, $submit_action, $submit_relationship, $submit_language, $submit_it)) { drupal_set_message(t(' Values have been saved.')); } else { drupal_set_message(t('There was an error saving your data. Please try again.')); } }

    Read the article

  • Django CMS - not able to upload images through cmsplugin_filer_image

    - by Luke
    i have a problem with a local installation on django cms 2.3.3: i've installed it trough pip, in a separated virtualenv. next i followed the tutorial for settings.py configuration, i started the server. Then in the admin i created an page (home), and i've tried to add an image in the placeholder through the cmsplugin_filer_image, but the upload seems that doesn't work. here's my settings.py: # Django settings for cms1 project. # -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '[email protected]'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'cms1', # Or path to database file if using sqlite3. 'USER': 'cms', # Not used with sqlite3. 'PASSWORD': 'cms', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # In a Windows environment this must be set to your system time zone. TIME_ZONE = 'Europe/Rome' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'it-it' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # If you set this to False, Django will not format dates, numbers and # calendars according to the current locale. USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" MEDIA_ROOT = os.path.join(PROJECT_PATH, "media") # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" MEDIA_URL = '/media/' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" STATIC_ROOT = os.path.join(PROJECT_PATH, "static") STATIC_URL = "/static/" # Additional locations of static files STATICFILES_DIRS = ( os.path.join(PROJECT_PATH, "static_auto"), # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # Make this unique, and don't share it with anybody. SECRET_KEY = '^c2q3d8w)f#gk%5i)(#i*lwt%lm-!2=(*1d!1cf+rg&amp;-hqi_9u' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'cms.middleware.multilingual.MultilingualURLMiddleware', 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'cms1.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'cms1.wsgi.application' TEMPLATE_DIRS = ( os.path.join(PROJECT_PATH, "templates"), # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) CMS_TEMPLATES = ( ('template_1.html', 'Template One'), ('template_2.html', 'Template Two'), ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.i18n', 'django.core.context_processors.request', 'django.core.context_processors.media', 'django.core.context_processors.static', 'cms.context_processors.media', 'sekizai.context_processors.sekizai', ) LANGUAGES = [ ('it', 'Italiano'), ('en', 'English'), ] INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'cms', #django CMS itself 'mptt', #utilities for implementing a modified pre-order traversal tree 'menus', #helper for model independent hierarchical website navigation 'south', #intelligent schema and data migrations 'sekizai', #for javascript and css management #'cms.plugins.file', 'cms.plugins.flash', 'cms.plugins.googlemap', 'cms.plugins.link', #'cms.plugins.picture', 'cms.plugins.snippet', 'cms.plugins.teaser', 'cms.plugins.text', #'cms.plugins.video', 'cms.plugins.twitter', 'filer', 'cmsplugin_filer_file', 'cmsplugin_filer_folder', 'cmsplugin_filer_image', 'cmsplugin_filer_teaser', 'cmsplugin_filer_video', 'easy_thumbnails', 'PIL', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', ) # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error when DEBUG=False. # See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, } } when i try to upload an image, in the clipboard section i don't have the thumbnail, but just an 'undefined' message: and this is the runserver console while trying to upload: [20/Oct/2012 15:15:56] "POST /admin/filer/clipboard/operations/upload/?qqfile=29708_1306856312320_7706073_n.jpg HTTP/1.1" 500 248133 [20/Oct/2012 15:15:56] "GET /it/admin/filer/folder/unfiled_images/undefined HTTP/1.1" 301 0 [20/Oct/2012 15:15:56] "GET /it/admin/filer/folder/unfiled_images/undefined/ HTTP/1.1" 404 1739 Also, this is project filesystem: cms1 +-- cms1 ¦   +-- __init__.py ¦   +-- __init__.pyc ¦   +-- media ¦   ¦   +-- filer_public ¦   ¦   +-- 2012 ¦   ¦   +-- 10 ¦   ¦   +-- 20 ¦   ¦   +-- 29708_1306856312320_7706073_n_1.jpg ¦   ¦   +-- 29708_1306856312320_7706073_n_2.jpg ¦   ¦   +-- 29708_1306856312320_7706073_n_3.jpg ¦   ¦   +-- 29708_1306856312320_7706073_n_4.jpg ¦   ¦   +-- 29708_1306856312320_7706073_n_5.jpg ¦   ¦   +-- 29708_1306856312320_7706073_n_6.jpg ¦   ¦   +-- 29708_1306856312320_7706073_n_7.jpg ¦   ¦   +-- 29708_1306856312320_7706073_n.jpg ¦   ¦   +-- torrent-client-macosx.jpg ¦   +-- settings.py ¦   +-- settings.pyc ¦   +-- static ¦   +-- static_auto ¦   +-- static_manual ¦   +-- templates ¦   ¦   +-- base.html ¦   ¦   +-- template_1.html ¦   ¦   +-- template_2.html ¦   +-- urls.py ¦   +-- urls.pyc ¦   +-- wsgi.py ¦   +-- wsgi.pyc +-- manage.py So files are uploaded, but they are not accessible to cms. there's a similar question here, but doens't help me so much. It would be very helpful any help on this issue to me. Thanks, luke

    Read the article

  • File upload iis7

    - by maxwell
    Hi, I have a website and my users can browse the website for general information. If user wants to post any data, they need to register in the website. At the time of registration (in registration form) they can upload their photo. Once registration process is completed they can even modify the previously uploaded photo. My users are facing problem while they uploading their photo at the time of registration. I have given write permission to uploading files folder. But it is giving "Access denied" error. There should be a provision to upload files with or without logging into application. How can we achieve this?

    Read the article

  • ajax upload cannot process JSON response or gives download popup

    - by Jorre
    I'm using the AJAX plugin from Andris Valums: AJAX Upload ( http://valums.com/ajax-upload/ ) Copyright (c) Andris Valums It works great, except for the fact that I cannot send proper JSON as a response. I'm setting the headers to 'Content-Type', 'application/json' before sending the JSON-encoded response, and in the plugin I'm saying that I'm expecting JSON: responseType: "json", This gives me a download popup asking to download the JSON/REPONSE file. The strange thing is, when I don't ass the correct "Content-Type" to my response, it works. Of course I want to pass the correct response type, because all my jQuery 1.4 calls are depending on correct JSON. Does anyone else have had this same problem or is there anyone out there willing to try this out ? I'd love to use this plugin but only when I can return proper JSON with the correct content-type Thanks for all your help!

    Read the article

  • Large file upload into WSS v3

    - by Rubens Farias
    I'd built an WSSv3 application which upload files in small chunks; when every data piece arrives, I temporarly keep it into a SQL 2005 image data type field for performance reasons**. Problem come when upload ends; I need to move data from my SQL Server to Sharepoint Document Library through WSSv3 object model. Right now, I can think two approaches: SPFileCollection.Add(string, (byte[])reader[0]); // OutOfMemoryException and SPFile file = folder.Files.Add("filename", new byte[]{ }); using(Stream stream = file.OpenBinaryStream()) { // ... init vars and stuff ... while ((bytes = reader.GetBytes(0, offset, buffer, 0, BUFFER_SIZE)) 0) { stream.Write(buffer, 0, (int)bytes); // Timeout issues } file.SaveBinary(stream); } Are there any other way to complete successfully this task? ** Performance reasons: if you tries to write every chunk directly at Sharepoint, you'll note a performance degradation as file grows up (100Mb).

    Read the article

  • Upload file via HTTP from VBA (WinHTTP)

    - by chiccodoro
    Hi all, I'm trying to HTTP upload a binary file programmatically from within VBA. I intend to put an ASPX page on the server. I know there are lots of nice ways to do that (e.g. use web service instead of aspx), but my constraint is that it must run in VBA (in an excel file), and that I cannot install any additional components on the client. So I guess I'll use WinHTTP, and I've found several examples to post form data, but not to post a binary file. I probably need to base64 the file contents? If so, please let me know. If I can make WinHTTP do file encoding for me, please let me know. If there is a much better way to reach my goal (Upload file from within VBA, server needn't necessarily be ASPX, could be a ASP.NET-Web service as well), please let me know... Thx, chiccodoro

    Read the article

  • Upload 1GB files using chunking in PHP

    - by rjha94
    I have a web application that accepts file uploads of up to 4 MB. The server side script is PHP and web server is NGINX. Many users have requested to increase this limit drastically to allow upload of video etc. However there seems to be no easy solution for this problem with PHP. First, on the client side I am looking for something that would allow me to chunk files during transfer. SWFUpload does not seem to do that. I guess I can stream uploads using Java FX (http://blogs.sun.com/rakeshmenonp/entry/javafx_upload_file ) but I can not find any equivalent of request.getInputStream in PHP. Increasing browser client_post limits or php.ini upload or max_execution times is not really a solution for really large files (~ 1GB) because maybe the browser will time out and think of all those blobs stored in memory. is there any way to solve this problem using PHP on server side? I would appreciate your replies.

    Read the article

  • FileReference and HttpService Browse Image Modify it then Upload it

    - by user177787
    Hello, I am trying to do an image uploader, user can: - browse local file with button.browse - select one and save it as a FileReference. - then we do FileReference.load() then bind the data to our image control. - after we make a rotation on it and change the data of image. - and to finish we upload it to a server. To change the data of image i get the matrix of the displayed image and transform it then i re-use the new matrix and bind it to my old image: private function TurnImage():void { //Turn it var m:Matrix = _img.transform.matrix; rotateImage(m); _img.transform.matrix = m; } Now the mater is that i really don't know how to send the data as a file to my server cause its not stored in the FileReference and data inside FileReference is readOnly so we can't change it or create a new, so i can't use .upload();. Then i tried HttpService.send but i can't figure out how you send a file and not a mxml.

    Read the article

  • Slow PDF upload for Confluence

    - by JPJedi
    We run a site that we host that uses the Atlassian Confluence. The site works great and is being used now. But there is one thing. It seems like when pdf and gifs are uploaded the upload speed will be slower. But the smaller files will upload fine. Has anyone else having an issue with uploading pdf's into confluence? I am trying to use fiddler to track the speed but am not having luck with that. Any information would be greatly appreciated.

    Read the article

  • creating a custom upload progress bar

    - by michael
    hi, i have seen all the upload progress bar plugins , widgets, etc. they all suck. their either too bulky with too much useless code or they dont work. what i want to know is where can i read up on how to display an easy upload progress indicator. most browsers have a status progress bar on them below but it isnt very professional to use just that when dealing with clients. how does the browser do it? i want to know the internals of how the browser work with indication a status of something uploading and maybe i can make something using php & jquery. thanks

    Read the article

  • php - upload script mkdir saying file already exists when same directory even though different filename

    - by neeko
    my upload script says my file already exists when i try upload even though different filename <?php // Start a session for error reporting session_start(); ?> <?php // Check, if username session is NOT set then this page will jump to login page if (!isset($_SESSION['username'])) { header('Location: index.html'); } // Call our connection file include('config.php'); // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/JPG", "image/jpeg", "image/bmp", "image/gif", "image/png"); if (in_array($file['type'], $valid_types)) return 1; return 0; } // Just a short function that prints out the contents of an array in a manner that's easy to read // I used this function during debugging but it serves no purpose at run time for this example function showContents($array) { echo "<pre>"; print_r($array); echo "</pre>"; } // Set some constants // Grab the User ID we sent from our form $user_id = $_SESSION['username']; $category = $_POST['category']; // This variable is the path to the image folder where all the images are going to be stored // Note that there is a trailing forward slash $TARGET_PATH = "img/users/$category/$user_id/"; mkdir($TARGET_PATH, 0755, true); // Get our POSTed variables $fname = $_POST['fname']; $lname = $_POST['lname']; $contact = $_POST['contact']; $price = $_POST['price']; $image = $_FILES['image']; // Build our target path full string. This is where the file will be moved do // i.e. images/picture.jpg $TARGET_PATH .= $image['name']; // Make sure all the fields from the form have inputs if ( $fname == "" || $lname == "" || $image['name'] == "" ) { $_SESSION['error'] = "All fields are required"; header("Location: error.php"); exit; } // Check to make sure that our file is actually an image // You check the file type instead of the extension because the extension can easily be faked if (!is_valid_type($image)) { $_SESSION['error'] = "You must upload a jpeg, gif, or bmp"; header("Location: error.php"); exit; } // Here we check to see if a file with that name already exists // You could get past filename problems by appending a timestamp to the filename and then continuing if (file_exists($TARGET_PATH)) { $_SESSION['error'] = "A file with that name already exists"; header("Location: error.php"); exit; } // Lets attempt to move the file from its temporary directory to its new home if (move_uploaded_file($image['tmp_name'], $TARGET_PATH)) { // NOTE: This is where a lot of people make mistakes. // We are *not* putting the image into the database; we are putting a reference to the file's location on the server $imagename = $image['name']; $sql = "insert into people (price, contact, category, username, fname, lname, expire, filename) values (:price, :contact, :category, :user_id, :fname, :lname, now() + INTERVAL 1 MONTH, :imagename)"; $q = $conn->prepare($sql) or die("failed!"); $q->bindParam(':price', $price, PDO::PARAM_STR); $q->bindParam(':contact', $contact, PDO::PARAM_STR); $q->bindParam(':category', $category, PDO::PARAM_STR); $q->bindParam(':user_id', $user_id, PDO::PARAM_STR); $q->bindParam(':fname', $fname, PDO::PARAM_STR); $q->bindParam(':lname', $lname, PDO::PARAM_STR); $q->bindParam(':imagename', $imagename, PDO::PARAM_STR); $q->execute(); $sql1 = "UPDATE people SET firstname = (SELECT firstname FROM user WHERE username=:user_id1) WHERE username=:user_id2"; $q = $conn->prepare($sql1) or die("failed!"); $q->bindParam(':user_id1', $user_id, PDO::PARAM_STR); $q->bindParam(':user_id2', $user_id, PDO::PARAM_STR); $q->execute(); $sql2 = "UPDATE people SET surname = (SELECT surname FROM user WHERE username=:user_id1) WHERE username=:user_id2"; $q = $conn->prepare($sql2) or die("failed!"); $q->bindParam(':user_id1', $user_id, PDO::PARAM_STR); $q->bindParam(':user_id2', $user_id, PDO::PARAM_STR); $q->execute(); header("Location: search.php"); exit; } else { // A common cause of file moving failures is because of bad permissions on the directory attempting to be written to // Make sure you chmod the directory to be writeable $_SESSION['error'] = "Could not upload file. Check read/write persmissions on the directory"; header("Location: error.php"); exit; } ?>

    Read the article

  • Automatic upload of 10KB file to web service?

    - by Joseph Turian
    I am writing an application, similar to Seti@Home, that allows users to run processing on their home machine, and then upload the result to the central server. However, the final result is maybe a 10K binary file. (Processing to achieve this output is several hours.) What is the simplest reliable automatic method to upload this file to the central server? What do I need to do server-side to prevent blocking? Perhaps having the client send mail is simple and reliable? NB the client program is currently written in Python, if that matters.

    Read the article

  • Zend Framework: isValid() clears values from disabled form fields!

    - by Andrew
    When you submit a form, disabled form fields are not submitted in the request. So if your form has a disabled form field, it makes working with Zend_Form::isValid() a little frustrating. $form->populate($originalData); $form->my_text_field->disabled = 'disabled'; if (!$form->isValid($_POST)) { //form is not valid //since my_text_field is disabled, it doesn't get submitted in the request //isValid() will clear the disabled field value, so now we have to re-populate the field $form->my_text_field->value($originalData['my_text_field']); $this->view->form = $form; return; } // if the form is valid, and we call $form->getValues() to save the data, our disabled field value has been cleared! Without having to re-populate the form, and create duplicate lines of code, what is the best way to approach this problem?

    Read the article

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