file upload - VB.NET Custom SqlFactory, FileUpload Control issue -


I SqlFactory to build my StoredProcedures class to control , And I'll use it for all transactions between the application and SQLServer. The file that I have applied lastly is a file upload. But it will not work as it should be :( I searched around the web, can not be found too much.

So basically I want to save my Report with name , description , and image . Names and details are working perfectly, but due to some reason this file will not be uploaded, then this code will be uploded Do not reach for that:

  And if fuImage.PostedFile is nothing OrElse String.IsNullOrEmpty (fuImage.PostedFile.FileName) OrElse fuImage.PostedFile.InputStream nothing and nothing dim imagebytes (fuImage.PostedFile.InputStream.Length) byte fuImage.PostedFile.InputStream.Read (imagebytes, 0, imagebytes.Length) rep.FuImage = imagebytes then upload as representatives end .Name = txtName.Text rep.Description = txtReportContent.Text repFac.Save (representatives)   

lines rep.FuImage = imagebytes and down those if Statements are my factory line, so do the work It should, but it FuImage FileUpload never control that should be selected to recognize a file

This is part of my thoughts :.

  & lt; Asp: FileUpload id = "fuImage" runat = "server" CssClass = "fontChange" /> & Lt; ASP: RegularExpressionValidator id = "rExpImage" runat = "server" ControlToValidate = "fuImage" Error = "Only .gif, .jpg, .png, .tiff and .jpeg" ValidationExpression = "(* \ ([Gg ..] [ Ii] [ff]) |. * \ ([Jj] [pp] [gg]) | ... * \ ([BB] [Mm] [PP]) | .. * \ ([PP] [ Anaan] [GG]) |. *. ([TT] [II] [II] [FF] $) "validation group =" Riportwalideteshn Somuri "CSS class =" failure information "& gt; * & lt; / asp: RegularExressianWaleneteter & gt;   

Note: I know that FileUpload does not work in asp: UpdatePanel , so I Regularly using asp: panel , I should suspect that if there are problems with all the panels controls ... besides this, I've seen many problems

Edit: I also have a lot of things, and I have suffered a lot.

Code> tried to work around the form , nothing came from my server side form master page, and it's the only one I use. I have tried to keep the form on every page, rather than nothing changed. (Read this in any question, I thought I would also try.)

Fixed & Lt; ContentTemplate & gt; There was a problem around & lt; Asp: UpdatePanel & gt; and my EditPanel was regular & lt; Asp: panel & gt; ; . In this way it will not make any difference that FileUpload is not in the update panel. & lt; Triggers & gt;

The code must be set as a full post with the code trigger :

  & lt; Trigger & gt; & Lt; Asp: PostBackTrigger ControlID = "Your_Control_ID" /> & Lt; / Trigger & gt;    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -