C# - Upload Only Jpeg Files?
Jan 15, 2011i want to upload files that are only jpeg, jpg etc. But i couldn't filter the files in the opening window. I want to change the text "all files" to jpeg etc. in the asp.net. (C#)
View 3 Repliesi want to upload files that are only jpeg, jpg etc. But i couldn't filter the files in the opening window. I want to change the text "all files" to jpeg etc. in the asp.net. (C#)
View 3 RepliesI have many (>600) EPS files(300 KB - 1 MB) in database. In my ASP.NET application (using ASP.NET 4.0) I need to retrieve them one by one and call a web service which would convert the content to the JPEG file and update the database (JPEGContent column with the JPEG content). However, retrieving the content for 600 of them itself takes too long from the SQL management studio itself (takes 5 minutes for 10 EPS contents).
So I have two issues:-
1) How to get the EPS content ( unfortunately, selecting certain number of content is not an option :-( ):-
Approach 1:-
foreach(var DataRow in DataTable.Rows)
{
// get the Id and byte[] of EPS
// Call the web method to convert EPS content to JPEG
}
or
foreach(var DataRow in DataTable.Rows)
{
// get only the Id of EPS
// Hit database to get the content of EPS
// Call the web method to convert EPS content to JPEG
}
or
Any other approach?
2) Converting EPS to JPEG using a web method for >600 contents. Ofcourse, each call would be a long running operation. Would task parellel library (TPL) be a better way to achieve this?
Also, is doing the entire thing in a SQL CLR function a good idea?
EDIT :- Unfortunately, I have to do this in the ASP.NET application itself and doing that in a separate process like Windows service is not an option.
Please help to understand this RegEx statement in details. It's supposed to validate filename from ASP.Net FileUpload control to allow only jpeg and gif files. It was designed by somebody else and I do not completely understand it. It works fine in Internet Explorer 7.0 but not in Firefox 3.6.
<asp:RegularExpressionValidator id="FileUpLoadValidator" runat="server"
ErrorMessage="Upload Jpegs and Gifs only."
ValidationExpression="^(([a-zA-Z]:)|(\{2}w+)$?)(\(w[w].*))(.jpg|.JPG|.gif|.GIF)$"
ControlToValidate="LogoFileUpload">
</asp:RegularExpressionValidator>
Im using a file uploader to upoad files to a folder used for upload.But the problem is this folder is a linux folder. I have made it a shared folder so that I can access from windows by samba. So, file transfer is successful when I'm using os but when I try to upload something from my websites uploader to this folder, this process is not successful. I have given all permissions to this folder.Don't know whats the problem.I have used both type of slashes for directory but still it is not successful.
View 4 Repliesi am trying to upload files through the ASP.NET File Upload control.
Every thing is working fine, except for the fact that when i try to upload the file on the server i am getting an error: (probably some authorization exception).
do i need to give some rights to the upload up there on the server. If so then for which account and do i need to restart the server after giving rights?
I want to allow a user to upload several files with one upload action. What is the simplest way to do this?
View 3 Repliesi am using file upload control to upload the files in asp.net with vb.net as code behind. am storing the files in my local drive. my doubt is, how shall i read those file using asp.net application.
View 1 Replieshow do i upload 20mb files using ASP.net. (using file upload control i have mentioned the following in httpruntime of web config file.
executionTimeout="90"
maxRequestLength="65536"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
enableVersionHeader="true"
how to upload .txt files to sql database using asp.net(C#)
View 1 RepliesHow to upload files from ASP.NET web application to any web server(linux)..
View 2 RepliesI've been looking for a way to achieve this behavior and I found this sample project.
The trick in this project is that it changes the form target to an iframe created on the fly.
So far so good, I can get the byte[] on the server-side. But I need to change an image preview after the file is uploaded.
How can I get the iframe to update the main page? Would I have to save it on a file on the disk, make a javascript callback to change the image url? Is there another way to do this? What's recommended?
I have deployed my software on a server,In my software there is a tool which reads an excel file and displays the content in a gridView.
It's working fine on my stand-alone PC, how can I do it on the web?
Should I upload my excel files on server and then read it or directly read it from the user's PC?
I am unable to upload files, here is my aspx file
<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master"
i write a FileServer Project (For uploading Files and give them to users), it is webapplication, i want to upload files to another server ( i mean another computer), i have its address : (172.16.10.30), so what should i do?
View 7 RepliesThat's maybe a strange subject but it was the best I could come up with. The thing is I need to upload a set of files from a web site into our CMS. I know how to do this via a file upload control but is it possible to do this when I've instead got URL's to the files? They are pictures by the way. Is it possible to get a file located on another server into a Stream?
View 8 RepliesCan I upload files without having a fileupload control? I was looking at the HttpFileCollection class, but I believe that only works with the fileupload control.
View 18 RepliesWe use the MojoPortal to a website and have some problems to upload files that is around 100 MB with the upload module. (Pleas note that this has probably nothing to do with MojoPortal but with the ASP.NET and the IIS)
The MojoPortal is set to use regular file Upload(not Neat Uploader) and to be able to upload big files we have set the following :
<httpRuntime maxRequestLength="2097151" executionTimeout="18000" requestValidationMode="2.0"/>
And :
<compilation debug="false" defaultLanguage="C#" targetFramework="4.0">
The problem is that the upload will cacel after a couple of minuts (Aborted).
Is there any other values that I need to set to make this possible? The MojoPortal itself should not have any settings for this as far as I know so its regular ASP.NET 4.0.
Anyone got some good pointers at an open source (article for creating your own would even be better) component to upload large files.SlickUpload for instance works great, and surely worth the money, but as this is for a pet project, a paid solution is just not what I'm after.
View 6 RepliesNeed to upload files in mapped drive. i tried with UNC path. locally i tried with 2 systems its working fine. but in production environment its not working. Scenario is, 2 systems with windows 2003 server. one is app server and second is data server. Hosted app in IIS. Its something with the drive/folder permissions.
View 1 RepliesI have a requirement where i need to upload mulitple files with one file upload control. I googled and found ajax uploader control but should be paied to use that. Is there any control similar to that which can be get at free of cost or could any one provide me sample code how can it be done.
Actually i have to upload car images and bike images to respective folders say carfolder and bikefolder. I used two fileupload controls one for car and other for bike and one button. when clicked on button the following code executes to upload the files
[Code]....
need complete ASP.Net with C# code to upload pdf ,word and image files ,save and also retrieving files from and to a SQL database directly.I need to have a webform which uploads different typesof files from hard drive to SQL database and also I want to retrive,delete,save these files in database
View 2 RepliesI am submitting my form's data that are input from textbox,dropdownlist,radiobuttons etc. to database using a XML web method which is submitting data asynchronously.Obviously page is not posted back and html input field's data are captured through javaScript code.Then with the javaScript code an XML Web Method is called with those input fields passed as parameters.
Upto this point everything is fine since all data that i have to submit is of string type.
But how can i upload attachments ? Thing is that i have to upload multiple attachments and all the attachments will be submitted when user clicks Submit button on the form.
When user clicks submit button on the form all form data and all files selected will be saved in the database through a XML web Serice which submits data asynchronously.
How can i upload files through XML Web Service ?
Let me first describe the actual need first.
I have a java application runnning on my pda ( a Windows Mobile device). I want to upload a text file from my device to a server using gprs connection.Currently I have a jboss server, and a client application in VC++ that uses the Wininet api.This VC++ client application establishes the gprs connection and also uses the http method of wininet api for file uploading. I am having difficulty using the http post method for uploading files to the jboss server. I want to use Http "PUT" method at client side.
So I want to create a application at server( I want to use IIS now instead of jboss),that would accept the byte stream from my VC++ client application and create a file at a folder on the server.
I am building a website where i need a page where user can upload large video files, i have created WCF service with streaming but i am calling that WCF service from Button_Click event of web page.
I have used below mentioned article for WCF service creation
WCF Streaming
I have used streaming as it should be efficient and should not be buffered in memory of server.
Now questions
1) I am having doubts that the entire file is uploaded to the web server and then it is transferred to WCF Service server...if this is true then i am not getting advantage of streaming as well as iis and web server will be down very soon if user uploads large file or multiple user are uploading files con currently
2) Is there any other efficient way to do same operation with some other technique
EDIT :
If I am not calling WCF Service method from ASP .Net code in that case also it is transferring bytes to the web server which i have checked with HTTPFox
I have checked above thing with upload control and putting one button on UI whose click event is bound to one method in code behind.
So, still i am having that confusion that how data is transferred
Client Machine - Web Server (ASP .Net Application) - Service Server (WCF Service)
Client Machine - Service Server (WCF Service)
NOTE : If i am putting a debug point on button_click and uploading 10 kb file it hits that in less then 1 sec. but if i am uploading 50 mb file then it is taking time.
I placed code of calling WCF service inside that button_click event
I'm new in ASP.NET , I finished one website by ASP.NET with Visual basic (2008), It's contains 2 files (Default.aspx & Thanks.aspx). The Default.aspx is main page. Now I want to upload them on server. I already have space on one server.
I did publish web site then the Visual Created one folder is PrecompiledWeb contain other folder with the same project name inside it these files (App_LocalResources , bin ,images , Default , PrecompiledApp , Thanks and web) , I uploaded these files on the server in www folder. but it's is not working if I will enter in the web browser my website name. How I can config the website to work when I will enter my website name like this(www.xxxxx.com).