Search Results

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

Page 2/16 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest

    - by pAkY88
    I'm developing a servlet that receives a multipart request with content of multiple files, and I'm using apache commons file upload libraries. When I call parseRequest(request); method servlet throws following exception: GRAVE: Servlet.service() for servlet DiffOntology threw exception java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest at org.apache.commons.fileupload.servlet.ServletRequestContext.getContentType(ServletRequestContext.java:73) at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.(FileUploadBase.java:882) at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:349) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) at DiffOntology.doPost(DiffOntology.java:38) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) I put all libraries in WEB-INF/lib.

    Read the article

  • How to use @FileUpload.GetHtml inside Html.BeginForm and sumbit FilesList

    - by Diode
    There is a default submit button for the @FileUpload.GetHtml. But I am expecting to have a submit button inside the Html begin form and use that substitution to submit the list of files with some more parameters. But when I do that the passing IEnumerable is always null in the Action method. This is my Action method: [HttpPost] public ActionResult Change(IEnumerable filesList, Guid ID, string Btn) {.... @using (Html.BeginForm("Change", "Home",FormMethod.Post)) { <textarea id="textArea" name="epost2" class="frm_txtfield_big" style="float:left; width:638px; height:200px;"></textarea> <input type="hidden" name="supportID" value="@Model.ID" /> @FileUpload.GetHtml(name: "ChooseFile",initialNumberOfFiles: 1,allowMoreFilesToBeAdded: true,includeFormTag: false) .......} But this is not passing the list of files to the method. Am doing it wrong or what is the wrong with the code.

    Read the article

  • Bluimp file upload send data to the server on .fileupload

    - by MyName
    OK I've Googled...Googled and Googled again with no avail on how I can send data to the server like an ajax call's data option for the file upload: $('#file_upload').fileupload({ dataType: 'json', url: "@(Url.Action("UploadFiles", "ExcelUpload"))", // formData: function(form) { return [{ name: "dataTable", value : "@(Model)"}];}, progressall: function (e, data) { $(this).find('.progressbar').progressbar({ value: parseInt(data.loaded / data.total * 100, 10) }); }, done: function (e, data) { BadFile(e, data); } }); controller would look something like this: [HttpPost] public ContentResult UploadFiles(Mytype param1, MyType Param2) { .. } I want to do something similar to this: $.ajax({ url: "@(Url.Action("Action", "Controller"))", type: "post", data: { param1: value, param2: @(Model) } }); On the fileupload callback. Is this possible? How can I pass values to the ServerSide? Should I switch to a different uploader..? Please help me out! I need to resolve this as soon as possible.

    Read the article

  • Use fileupload as template field in a details view

    - by MyHeadHurts
    I have an admin page where a user will select a document path and add that path to a certain column of a database. I am using a fileupload on the page where they can find the document and copy the path and then paste it into the details view. However, I want to skip this step and I want them to select a document and automatically make the path show up in the details view. <asp:FileUpload ID="FileUpload1" runat="server" Visible="False" Width="384px" /><br /> <br /> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <center> <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" DataKeyNames="ID" DataSourceID="SqlDataSource1" Height="128px" Width="544px" Visible="False" OnModeChanged="Button2_Click" CellPadding="4" ForeColor="#333333" GridLines="None" > <Fields> <asp:BoundField DataField="Order" HeaderText="Order" SortExpression="Order" /> <asp:BoundField DataField="Department" HeaderText="Department" SortExpression="Department"/> <asp:BoundField DataField="DOC_Type" HeaderText="DOC_Type" SortExpression="DOC_Type" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Revision" HeaderText="Revision" SortExpression="Revision" /> <asp:BoundField DataField="DOC" HeaderText="DOC" SortExpression="DOC" /> <asp:BoundField DataField="Active" HeaderText="Active" SortExpression="Active" /> <asp:BoundField DataField="Rev_Date" HeaderText="Rev_Date" SortExpression="Rev_Date" /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" Visible="False" /> <asp:CommandField ShowInsertButton="True" /> </Fields> <FooterStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#E2DED6" BorderStyle="None" Font-Bold="True" /> <RowStyle BackColor="#F7F6F3" BorderStyle="None" ForeColor="#333333" /> <FieldHeaderStyle BackColor="#E9ECF1" BorderStyle="None" Font-Bold="True" /> <EmptyDataRowStyle BorderStyle="None" /> <PagerStyle BackColor="#284775" BorderStyle="None" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" /> <InsertRowStyle BorderStyle="None" /> <EditRowStyle BackColor="#999999" BorderStyle="None" /> <AlternatingRowStyle BackColor="White" BorderStyle="None" ForeColor="#284775" /> </asp:DetailsView> &nbsp; <br /> I need to get the fileupload1 into the DOC contenttemplate area so instead of showing an empty textbox it will show just a textbox it will show the fileupload

    Read the article

  • Uploading multiple files asynchronously by blueimp jquery-fileupload

    - by Ryo
    I'm using jQuery File Upload library (http://github.com/blueimp/jQuery-File-Upload), and I've been stuck figuring out how to use the library satisfying the following conditions. The page has multiple file input fields surrounded by a form tag. Users can attach multiple files to each input field All files are sent to a server when the button is clicked, not when files are attached to the input fields. Upload is done asynchronously Say the page has 3 input fields with their name attributes being "file1[]", "file2[]" and "file3[]", the request payload should be like {file1: [ array of files on file1[] ], file2: [ array of files on file2[] ], ...} Here's jsFiddle, it's behaving weird so far in that it sends post request twice and the first one is cancelled. http://jsfiddle.net/BAQtG/24/ The core part of js code looks like this. $(document).ready(function(){ var filesList = [] var elem = $("form") file_upload = elem.fileupload({ formData:{extra:1}, autoUpload: false, fileInput: $("input:file"), }).on("fileuploadadd", function(e, data){ filesList.push(data.files[0]) }); $("button").click(function(){ file_upload.fileupload('send', {files:filesList} ) }) }) Anybody have idea how to get this to work? Updates Now thanks to @CBroe 's comment, the issue that request is sent twice is fixed. However the keys of request parameter is not correctly set. Here's updated jsFiddle. http://jsfiddle.net/BAQtG/27/

    Read the article

  • FileUpload ASP.NET control not working under Windows 7

    - by YourMomzThaBomb
    I have a User Control that contains a System.Web.UI.WebControls.FileUpload control as well as a button to 'Submit'. When the button is clicked code similar to the following is executed: If FileUploadControl.HasFile Then 'Save the file and do some other stuff End If This code works just fine with Windows XP. However, if I run it from a Windows 7 64-bit machine using IE8 32-bit the HasFile property always returns false and nothing is saved?! Any suggestions/ideas would be greatly appreciated.

    Read the article

  • FileUpload control event

    - by user321632
    I want to know how to raise an event for fileupload control.... In my project, as soon as I select a file(Image) it should show FILENAME,EXTENSION & SIZE in the labels given below. Pls reply me.... Thanks in advance.

    Read the article

  • change Visibility of a control in ASP.NET code behind (c#)

    - by Axel Grude
    How do you set the visibility of a (fileupload) control from ASP.net code (I need to hide a fileupload control in a webuser control from server site, otherwise hasFIle is always false). Also setting the "Visible" property to false does not work (as is confuses the AJAX panel so the fileupload forgets that it has a file). theFileUpload.Visible = false = does not work so I want to try to set the CSS style visibility to hidden or display to none. The main problem is I want to do it from the server side (I know how I could do it on client). Is there a safe way to overwrite theFileUpload.Attributes["styles"] in case I modify other CSS styles in there, also throwing a whole CSS class at it (by moidifying the CSSClass property) seems like overkill. thanks in advance Axel

    Read the article

  • Display only file name in FileUpload control

    - by Jagd
    I have a webpage in asp.net 3.5 that uses the FileUpload control. When a user clicks on the "Browse" button (which is part of the control) the control displays a file select popup (dialog box). When the user selects the file which they wish to upload, by default the full path to the file is shown in the textbox (which is also part of the control); however, I wish for it to only display the file name and not the full path. Anyone know of a slick and easy way to do this?

    Read the article

  • GoogleAppEngine : possible to disable FileUpload?

    - by James.Elsey
    Hi, When I deploy my application to GoogleAppEngine I keep getting the following error Uncaught exception from servlet java.lang.NoClassDefFoundError: java.io.FileOutputStream is a restricted class. Please see the Google App Engine developer's guide for more details. at com.google.apphosting.runtime.security.shared.stub.java.io.FileOutputStream.<clinit>(FileOutputStream.java) at org.apache.log4j.FileAppender.setFile(FileAppender.java:289) at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163) at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96) at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654) at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612) at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468) at org.apache.log4j.LogManager.<clinit>(LogManager.java:122) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685) at org.springframework.web.context.ContextLoader.<clinit>(ContextLoader.java:146) at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123) at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:243) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5485) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5483) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:398) at com.google.net.rpc.impl.Server$2.run(Server.java:852) at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:536) at com.google.net.rpc.impl.Server.startRpc(Server.java:807) at com.google.net.rpc.impl.Server.processRequest(Server.java:369) at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:442) at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290) at com.google.net.async.Connection.handleReadEvent(Connection.java:474) at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:831) at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207) at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103) at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251) at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:404) at java.lang.Thread.run(Unknown Source) I've checked the documentation and it suggests to create a FileUpload class, since I won't be uploading files/documents etc from my application, is this necessary? Is there a way to disable this functionality, or at least bypass this error? I have already provided implementation for a MultipartWrapperFactory.Class as that has been suggested from searching for this error Thanks

    Read the article

  • ASP.NET - FileUpload with PostBack Trigger

    - by Echilon
    I have an UpdatePanel which has an upload control and a button to upload. The button is set as a trigger, but the event handler for the button fails to execute on the first PostBack. My ASPX code is: <asp:UpdatePanel ID="updPages" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div class="tabs"> <ul> <li><asp:LinkButton ID="lnkContentsPages" runat="server" OnClick="updateContents" CommandArgument="pages">Pages</asp:LinkButton></li> <%-- these tabs change the ActiveViewIndex to show a different UserControl --%> <li><asp:LinkButton ID="lnkContentsImages" runat="server" OnClick="updateContents" CommandArgument="images">Images</asp:LinkButton></li> </ul> <div class="tabbedContent"> <asp:MultiView runat="server" ID="mltContentsInner" ActiveViewIndex="0"> <asp:View ID="viwContentsImages" runat="server"> // ajax usercontrol for a list of images - works fine with ajax <fieldset> <legend>Upload New</legend> <div class="formRow"> <asp:Label ID="lblFile" runat="server" Text="Filename" AssociatedControlID="uplFile" /> <asp:FileUpload ID="uplFile" runat="server" /> </div> <div class="formRow"> <asp:Label ID="lblImageDescription" runat="server" Text="Description" AssociatedControlID="txtImageDescription" /> <asp:TextBox runat="server" ID="txtImageDescription" /> </div> <asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="c3button btnUpload" CausesValidation="false" OnClick="btnUpload_Click" /> </fieldset> </asp:View> <asp:View ID="viwContentsPages" runat="server"> // ajax usercontrol - works fine with ajax </asp:View> </asp:MultiView> </div> </div> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="btnUpload" /> </Triggers> </asp:UpdatePanel> The button works without fail on the second and subsequent times, just not the first. Is there any reason for this?

    Read the article

  • Basic File upload in GWT

    - by Maksim
    I'm trying to figure out how to upload one file using GWTs FileUpload widget. I'm using GWT and Google AppEngine with Java but I would like to upload file to my own Linux server. I have the following code already but now I can't figure out how to submit my file to the Google AppServer server and save it to another server: public class FileUploader{ private ControlPanel cp; private FormPanel form = new FormPanel(); private FileUpload fu = new FileUpload(); public FileUploader(ControlPanel cp) { this.cp = cp; this.cp.setPrimaryArea(getFileUploaderWidget()); } @SuppressWarnings("deprecation") public Widget getFileUploaderWidget() { form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setMethod(FormPanel.METHOD_POST); // form.setAction(/* WHAT SHOULD I PUT HERE */); VerticalPanel holder = new VerticalPanel(); fu.setName("upload"); holder.add(fu); holder.add(new Button("Submit", new ClickHandler() { public void onClick(ClickEvent event) { GWT.log("You selected: " + fu.getFilename(), null); form.submit(); } })); form.addSubmitHandler(new FormPanel.SubmitHandler() { public void onSubmit(SubmitEvent event) { if (!"".equalsIgnoreCase(fu.getFilename())) { GWT.log("UPLOADING FILE????", null); // NOW WHAT???? } else{ event.cancel(); // cancel the event } } }); form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() { public void onSubmitComplete(SubmitCompleteEvent event) { Window.alert(event.getResults()); } }); form.add(holder); return form; } } Now, what do I need to do next? What do i need to put in web.xml and how do I write my servlet so i can store file and return url of that object (if possible)

    Read the article

  • FindControl in DataList Edit Mode

    - by Doug
    As a new .net/C# web begginner, I always get tripped up when I try to use FindControl. Blam -flat on my face. Here is my current FindControl problem: I have an .aspx page and Form, then ajax updatePanel, inside it there is my DataList (DataList1) that has an EditItemTemplate: that has the following: <EditItemTemplate> <asp:Label ID="thumbnailUploadLabel" runat="server" text="Upload a new thumbnail image:"/><br /> <asp:FileUpload ID="thumbnailImageUpload" runat="server" /> <asp:Button ID="thunbnailImageUploadButton" runat="server" Text="Upload Now" OnClick="thumbnailUpload"/><br /> </EditItemTemplate> In my C# code behind I have the OnClick code for the fileUpload object: protected void thumbnailUpload(object s, EventArgs e) { if (thumbnailImageUpload.HasFile) { //get name of the file & upload string imageName = thumbnailImageUpload.FileName; thumbnailImageUpload.SaveAs(MapPath("../../images/merch_sm/" + imageName)); //let'em know that it worked (or didn't) thumbnailUploadLabel.Text = "Image " + imageName + "has been uploaded."; } else { thumbnailUploadLabel.Text = "Please choose a thumbnail image to upload."; } So of course I'm getting "Object reference not set to an instance of an object" for the FileUpload and the Label. What is the correct syntax to find these controls, before dealing with them in the OnClick event? The only way Ive used FindControl is something like: label thumbnailUploadLabel = DataList1.FindControl("thumbnailUploadLabel") as Label; But of course this is throwing the "Object reference not set to an instance of an object" error. Any help is very much appreciated. (I've also seen the 'recursive' code out there that is supposed to make using FindControl easier. Ha! I'm so green at C# that I don't even know how to incorporate those into my project.) Thanks to all for taking a look at this.

    Read the article

  • JavaFX: File upload to REST service / servlet fails because of missing boundary

    - by spa
    I'm trying to upload a file using JavaFX using the HttpRequest. For this purpose I have written the following function. function uploadFile(inputFile : File) : Void { // check file if (inputFile == null or not(inputFile.exists()) or inputFile.isDirectory()) { return; } def httpRequest : HttpRequest = HttpRequest { location: urlConverter.encodeURL("{serverUrl}"); source: new FileInputStream(inputFile) method: HttpRequest.POST headers: [ HttpHeader { name: HttpHeader.CONTENT_TYPE value: "multipart/form-data" } ] } httpRequest.start(); } On the server side, I am trying to handle the incoming data using the Apache Commons FileUpload API using a Jersey REST service. The code used to do this is a simple copy of the FileUpload tutorial on the Apache homepage. @Path("Upload") public class UploadService { public static final String RC_OK = "OK"; public static final String RC_ERROR = "ERROR"; @POST @Produces("text/plain") public String handleFileUpload(@Context HttpServletRequest request) { if (!ServletFileUpload.isMultipartContent(request)) { return RC_ERROR; } FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List<FileItem> items = null; try { items = upload.parseRequest(request); } catch (FileUploadException e) { e.printStackTrace(); return RC_ERROR; } ... } } However, I get a exception at items = upload.parseRequest(request);: org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found I guess I have to add a manual boundary info to the InputStream. Is there any easy solution to do this? Or are there even other solutions?

    Read the article

  • Why can't upload three files with FileUpload ?

    - by Valter Henrique
    Hi everyone, i'm trying to upload three images to my server, is working, but upload always the last file selected by the user, not the three selected. Here's my code: protected void doPost(HttpServletRequest request, HttpServletResponse response){ boolean multipart = ServletFileUpload.isMultipartContent(request); if (multipart) { DiskFileItemFactory fileItemFactory = new DiskFileItemFactory(); fileItemFactory.setSizeThreshold(5 * 1024 * 1024); //5 MB fileItemFactory.setRepository(tmpDir); ServletFileUpload uploadHandler = new ServletFileUpload(fileItemFactory); try { List items = uploadHandler.parseRequest(request); Iterator itr = items.iterator(); while (itr.hasNext()) { FileItem item = (FileItem) itr.next(); File file = new File(dir, generateNewName()); item.write(file); } } catch (FileUploadException ex) { } catch (Exception ex) { } } } -- UPDATE: <html> <head> <title>Upload</title> </head> <body> <form action="Upload" method="post" enctype="multipart/form-data"> <input type="file" name="file1" /> <br /> <input type="file" name="file2" /> <br /> <input type="file" name="file3" /> <br /> <input type="submit" value="Enviar" /> </form> </body> </html> Best regards, Valter Henrique.

    Read the article

  • How to change fileupload name

    - by Domnic
    im using following code to upload protected void UploadButton_Click(object sender, EventArgs e) { if(FileUploadControl.HasFile) { try { string filename = Path.GetFileName(FileUploadControl.FileName); FileUploadControl.SaveAs(Server.MapPath("~/") + filename); StatusLabel.Text = "Upload status: File uploaded!"; } catch(Exception ex) { StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message; } } } i want to cahnge upload file name...i have to assign file name for every uploaded file how?

    Read the article

  • The SaveAs method is configured to require a rooted path, and the path <blah> is not rooted.

    - by Jen
    OK I've seen a few people with this issue - but I'm already using a file path, not a relative path. My code works fine on my PC, but when another developer goes to upload an image they get this error. I thought it was a security permission thing on the folder - but the system account has full access to the folder (though I get confused about how to test which account the application is running under). Also usually running locally doesn't often give you too many security issues :) A code snippet: Guid fileIdentifier = Guid.NewGuid(); CurrentUserInfo currentUser = CMSContext.CurrentUser; string identifier = currentUser.UserName.Replace(" ", "") + "_" + fileIdentifier.ToString(); string fileName1 = System.IO.Path.GetFileName(fileUpload.PostedFile.FileName); string Name = System.IO.Path.GetFileNameWithoutExtension(fileName1); string renamedFile = fileName1.Replace(Name, identifier); string path = ConfigurationManager.AppSettings["MemberPhotoRepository"]; String filenameToWriteTo = path + currentUser.UserName.Replace(" ", "") + fileName1; fileUpload.PostedFile.SaveAs(filenameToWriteTo); Where my config settings value is: Again this works fine on my PC! (And I checked the other person has the folder on their PC). Any suggestions would be appreciated - thanks :)

    Read the article

  • How to limit an upload speed in java servlet?

    - by den-javamaniac
    Hi. I'm working on an app (based on Spring as DI and MVC framework) that has a file upload function which is currently implemented using Spring Multipart Upload (which in it's turn utilizes commons fileupload libs). So what I'm looking for is a way to lower the upload bandwidth consumption. How can I accomplish that?

    Read the article

  • How to enable attachment using Apache File upload

    - by Stardust
    I am using Apache commons File upload API to Store the file from JSP to servlets in temp directory, but I don't know what should I do next to send the email as an attachment using javamail API. How can I retrieve those files which is written in temp directory using Apache Fileupload API to send them as attachment to mail Server. How will writing those files either to memory or disk will help me?

    Read the article

  • File Upload in asp.net

    - by vaibhav
    I am using FileUpload control to facilitate Image file upload on my website. I want to restrict a user to upload only Image file. I am using if (fupFirmLogo.PostedFile.ContentType == "image/Jpeg") { } to check if the file is a image or not. I want to allow all image extensions like PNG, GiF, Jpeg, tif , BMP etc. How should I do it.

    Read the article

  • ASP.Net File Upload Network Issue

    - by John Delate
    I have tried both the .net FileUpload control and the ajax Asyncfileuploadcontrol to upload a file less than 500kb. It seems that when I tried to go through my wireless router (att.bellsouth) that the uploads always fail, however when I plug my droid into my laptop and use my pda connection it works perfectly fine. I'm wondering if the network connection from my house to my server could be causing this issue, and if anyone had any solutions to this problem. Tomorrow I'm going to try and upload from other networks and pray it works.

    Read the article

  • Multiple File Selection For Uploading in ASP.NET

    - by IrfanRaza
    Hi Friends, There are several resources available on net to upload multiple files, but using multiple FileUpload controls. What I need to have multiple file selection dialog box so that user can select multiple files at one shot and then all files should be uploaded on one click. Anyone of you have any idea? Thanks in advance.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >