Search Results

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

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

  • There is a system alert of (13, 'Permission denied'), how to solve that?

    - by Semanty
    def upload_file(request, step_id): def handle_uploaded_file (file): current_step = Step.objects.get(pk=step_id) current_project = Project.objects.get(pk=current_step.project.pk) path = "%s/upload/file/%s/%s" % (settings.MEDIA_ROOT, current_project.project_no, current_step.name) if not os.path.exists (path): os.makedirs(path) fd = open(path) for chunk in file.chunks(): fd.write(chunk) fd.close() if request.method == 'POST': form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): handle_uploaded_file(request.FILES['file']) return HttpResponseRedirect('/success/url/') else: form = UploadFileForm() return render_to_response('projects/upload_file.html', { 'step_id': step_id, 'form': form, })

    Read the article

  • Uploadin Image - Objective C

    - by Sammaeliv
    Hi, i have this code the i find on youtube xD my cuestion is , how do i add an extra parameter NSData *imageData = UIImageJPEGRepresentation(imagen.image,0.0); NSString *urlString = @"http://urlexample.com/upload.php"; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"]; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; [request addValue:contentType forHTTPHeaderField:@"Content-Type"]; NSMutableData *body = [NSMutableData data]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"userfile\"; filename=\".jpg\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[NSData dataWithData:imageData]]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; [request setHTTPBody:body]; NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; NSLog(returnString); I try [body appendData:[[NSString stringWithFormat:@"extra=%@",info] dataUsingEncoding:NSUTF8StringEncoding]; hehehe im 100% new on this as you can see... please help me xD

    Read the article

  • PHP file upload not working with dynamic path

    - by Devdarsh
    i am trying to write a php upload script to upload files to different folders. My code works for direct path (something like 'path/to/directory') but not for dynamic path taken from runtime. $directory_self = dirname($_SERVER['PHP_SELF']); $folder = $_POST['folder_name']; //final folder $toupload = $_SERVER['DOCUMENT_ROOT'] . $directory_self .'/files'. $folder; $uploadsDirectory = str_replace (" ", "", $toupload); When i echo $uploadsDirectory it shows the exact path. Could any one help me what could be wrong in this?

    Read the article

  • [Need help]: Issue with submit button and html file input control’s Click() method

    - by somesh
    Scenario: On click of a button, we dynamically create html file input (file upload) control on the page and call that file input controls Click() method. User then selects the file from the disk. There is a “Submit” button to upload the selected file. Problem: The problem is, when clicked on “Submit” button first time, the input value from the file input control is cleared. And the request does not go to the server. When clicked second time, the request goes to server with empty file input value. Why the first click on submit button does not send the request to server. And why it clears the file input control value? Note: The issue is observed only when we call Click() method programmatically. If we let user to click browse, then in that case, the "Submit" does not clear the input value and sends request to server on first click itself. Any help would be appreciated. Thanks in advance. By the way, server side code is in asp.net and client side in java script, testing on IE. -Somesh

    Read the article

  • File uploads simply do not work - what could be wrog server side?

    - by vanneto
    This has been grinding my gears for at least a week now. I have a site which has a crucial function - the upload component. Without it, the site is completely useless. Now, lots of users have problems uploading files. This is why I implemented a log system that keeps track of what happens when the file is on the server. Problem is, only a minority of problems happen when the file is on the server, the problems happen client side. For example, when I tried SWFUpload the errors where 'I/O Error'. When I changed to Uploadify I get 'HTTP Error'. I am trying to get a more detailed error description as I type this. I am starting to think its not the client or the upload software, but the server. What could be wrong? The following directives for PHP are set: upload_max_filesize 200M post_max_size 200M memory_limit 256M max_execution_time 4200 max_input_time 4200 I simply have no clue why file uploads are failing. They should not fail. I would really appreciate any answers as why the uploads could be failing. Thank you.

    Read the article

  • File uploads simply do not work - what could be wrong server side?

    - by vanneto
    This has been grinding my gears for at least a week now. I have a site which has a crucial function - the upload component. Without it, the site is completely useless. Now, lots of users have problems uploading files. This is why I implemented a log system that keeps track of what happens when the file is on the server. Problem is, only a minority of problems happen when the file is on the server, the problems happen client side. For example, when I tried SWFUpload the errors where 'I/O Error'. When I changed to Uploadify I get 'HTTP Error'. I am trying to get a more detailed error description as I type this. I am starting to think its not the client or the upload software, but the server. What could be wrong? The following directives for PHP are set: upload_max_filesize 200M post_max_size 200M memory_limit 256M max_execution_time 4200 max_input_time 4200 I simply have no clue why file uploads are failing. They should not fail. I would really appreciate any answers as why the uploads could be failing. Thank you.

    Read the article

  • call a Javascript function from controller more than once (in Rails)

    - by mm1
    hi. I have a multiple file upload form(html5) and want to update my view as soon one of the images is transfered to my image server. Currently I upload the files with ajax and use response_to_parent to update my upload view when all images are transfered to the image server. Is it possible to call a Javascript function from the controller more than once per action? def upload params[:images].each do |file| upload_to_image_server(file) #page << Update upload View end end Thanks, Michael

    Read the article

  • Why can't I pass a form field of type file to a CFFUNCTION using structure syntax?

    - by Eric Belair
    I'm trying to pass a form field of type "file" to a CFFUNCTION. The argument type is "any". Here is the syntax I am trying to use (pseudocode): <cfloop from="1" to="5" index="i"> <cfset fieldname = "attachment" & i /> <cfinvoke component="myComponent" method="attachFile"> <cfinvokeargument name="attachment" value="#FORM[fieldname]#" /> </cfinvoke> </cfloop> The loop is being done because there are five form fields named "attachment1", "attachment2", et al. This throws an exception in the function: coldfusion.tagext.io.FileTag$FormFileNotFoundException: The form field C:\ColdFusion8\...\neotmp25080.tmp did not contain a file. However, this syntax DOES work: <cfloop from="1" to="5" index="i"> <cfinvoke component="myComponent" method="attachFile"> <cfinvokeargument name="attachment" value="FORM.attachment#i#" /> </cfinvoke> </cfloop> I don't like writing code like that in the second example. It just seems like bad practice to me. So, can anyone tell me how to use structure syntax to properly pass a file type form field to a CFFUNCTION??

    Read the article

  • Why file upload error codes in php miss number '5'?

    - by Majid
    I am writing a custom error handling/reporting function for php file upload and I noticed that the error codes returned is one of numbers 0 to 8 except 5. Is this a typo in the source I am using or is it really this way? And if it is so, I am curious why they have skipped number '5'. Thanks.

    Read the article

  • html file upload as part of another form

    - by samsina
    Idealy I would like to have the following: <form1 ...> ... <form2 ...> //This form uploads a file using AJAX and writes the content into a text field below. </form2> <input type="text"/> </form1> Firefox handles this but IE likes to follow the rules of W3C this time and it doesn't really work. So now I have to handle form2 outside of form1 through javascript. Can you provide some help about how to go about this? Thanks in advance.

    Read the article

  • Best approach for storing uploaded image

    - by Sunny
    What are the advantages and disadvantages of storing an image as a blob in the database vs storing just the file name in the database. I'm using PHP(CodeIgniter) with MySQL. I know this question is subjective but a client asked me this question and I couldn't give a good answer.

    Read the article

  • How to pass a vlue to an ajaxUpload function?

    - by iMad
    This is my Html code and I'm trying to pass my id(test1) to fileUp function. It only works when I type 'test1' and stops working when I'm trying to pass a variable. Please let me know if there is a way to overcome this problem. <a id='test1' href="#" onclick="fileUp(1, 'test1')">Upload Your file</a> function fileUp(id,nameTest){ var test=nameTest; new AjaxUpload(nameTest , { action: 'upload-test.php', onComplete: function(file, response){ alert(response); } }); };

    Read the article

  • Thumbnailing and then Saving as a Blob with PHP in Wordpress

    - by Parris
    The below code seems like it should work; however, the blob in the database only contains 0 after the function is run. Does the below code look accurate? If not how can I fix it? $tmpName = $_FILES['picture']['tmp_name']; $fp = fopen($tmpName, 'r'); $binary = fread($fp, filesize($tmpName)); fclose($fp); $originalImage = imagecreatefromstring($binary); $tempImage = imagecreate(100,100); imagecopyresized($tempImage,$originalImage,0,0,0,0,100,100); ob_start(); imageJPEG($tempImage); $thumbnail = ob_get_contents(); ob_end_clean(); $wpdb->query("UPDATE ".$wpdb->prefix."items SET picture = $thumbnail WHERE id=$id'"); Thank :)!

    Read the article

  • web application-file upload

    - by Dhanraj
    Hi, I am developing an web application. I am using file upload control to browse files. i have xls file in C:\Mailid.xls path. When i use FileUpload1.PostedFile.FileName command i was get the full path(C:\Mailid.xls). Today I installed IE 8 After the installation I unable to get the full path of the file what could be the problem Event I uninstalled IE 8. Currently I am using IE 7. how can i get the fullpath(C:\Mailid.xls) in my project. Regards Dhanraj.S

    Read the article

  • Is there a way to hide the Primefaces fileUpload progress bar and buttons in advanced mode and auto mode?

    - by Joe Roberts
    Is there a way to hide the Primefaces fileUpload progress bar and buttons in advanced mode and auto mode? Here is the code that I am using: <p:fileUpload id="scriptUpload" widgetVar="importDevicesWidget" fileUploadListener="#{scriptUploadBean.handleFileUpload}" auto="true" label="Choose.." mode="advanced" update=":infoMessages" sizeLimit="8192" allowTypes="/(\.|\/)(txt)$/" onstart="clearInvalidFileMsg();$('#progress').show();" oncomplete="clearInvalidFileMsg();$('#progress').hide();importDevicesDialogWidget.hide()"/> The problem is that it makes no sense for the buttons that appear next to the progress bar for each file to be there as the mode is auto so the upload already started! Here is a screen shot:

    Read the article

  • Increase Timeout for remote sessions in Debian 5 Lenny

    - by Ash
    I always get a remote connection time out when using PuTTy and also when i send emails with attachments from a mail sever installed on Debian. I always get this error. I'm not sure if this is firewall or the new Debian 5 installation which i made. Is there any settings i need to fix after fresh install. Any inputs are highly appreciated. This error is pulling my brains out. Thanks. Error: 2011-01-10 15:21:13,454 INFO [btpool0-23://69.19.19.89/service/upload?fmt=extended] [[email protected];mid=72;ip=10.10.01.78;ua=Mozilla/5.0 (Windows;; U;; Windows NT 5.2;; en-US;; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 (.NET CLR 3.5.30729);] FileUploadServlet - File upload failed org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. timeout at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) at com.zimbra.cs.service.FileUploadServlet.handleMultipartUpload(FileUploadServlet.java:430) at com.zimbra.cs.service.FileUploadServlet.doPost(FileUploadServlet.java:412) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:181) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at com.zimbra.cs.servlet.SetHeaderFilter.doFilter(SetHeaderFilter.java:79) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81) at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:132) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:218) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.DebugHandler.handle(DebugHandler.java:77) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:543) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:413) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451) Caused by: org.mortbay.jetty.EofException: timeout at org.mortbay.jetty.HttpParser$Input.blockForContent(HttpParser.java:1172) at org.mortbay.jetty.HttpParser$Input.read(HttpParser.java:1122) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887) at java.io.InputStream.read(InputStream.java:85) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362) ... 33 more

    Read the article

  • How to pass string file path as HttpPostedfile to fileupload control?

    - by rahul
    Hi friends, I have got little tricky issue i.e I am using API of a product which has few methods for uploading image. The UI part of the product has one file upload control which takes files and convert that into binary and save it to database. In the coding part they are using one method where they send this fileupload.postedfile as one of the input parameter to the method. Now my requirement is, I have a directory where there are hundred of files which i have to send each file one by after another to this method as a input. Now i wish to know how to pass a file name as "HttpPostedFile" to that method as a parameter. I have no other option other than using that API (our clients requirement). Thanks

    Read the article

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