|
can i upload multifile in one time ? in c#
e.x. for one file upload i wrote :
protected System.Web.UI.WebControls.FileUpload attach;
attach = new FileUpload();
item.Attachments.Add(attach.FileName, attach.FileBytes);
but now i want 3,4,5,... files in one time
|
|
|
|
|
ptvce wrote: can i upload multifile in one time
You have create your own control or you have to use 3 party control in asp.net.
There is no built in asp.net control that can upload multiple file.
|
|
|
|
|
Add 3 or 4 or 5 Upload Controls and add one Button that Will do the Upload for all these Control. add a Progress Bar so that your users will know what is happening.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
When you place more than one fileupload control, all the chosen files will be sent on submit of the request.
You will find each file in its file collection..
|
|
|
|
|
i want uppload a file in virtual directory Can i?
is it possible? can anybody help?
|
|
|
|
|
Have you try to search on google?[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
yes its Possible. Use the Upload control and set the destination of the File to your "App_Data" that is always shipped with your application or use the relative path.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Respected,
Hi sir ,I am save the image on server folder when I retrieve image for display from server folder
it not be display
my code is as follow :
Dim photo As String = "JC001924.jpg"
Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo
Image1.ImageUrl = Server.MapPath(strimage)
|
|
|
|
|
Your variable strimage returns correct path?! It seems to me that isn't correctly initialized.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
|
whats this..?
Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo
the easy way to find the path is to ..!
drop an image control and go to properties set the image url to the image which is stored in the folder..!and copy the path from the source which will generate by VS..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I might be missing something blindingly obvious here but you don't need to call Server.MapPath when setting an image url. Server.MapPath will give you the physical location on the server disk which is useless when the web page is sent to the client.
|
|
|
|
|
Server.MapPath will return the actual physical path which wont work as an image url. If you want to generate the virtual path at run time use Page.ResolveClientUrl method instead.
"Never put off until run time what you can do at compile time."
- David Gries, in "Compiler Construction for Digital Computers", circa 1969.
|
|
|
|
|
Hello there
I've a website that allows a user to create and download a document. I first save the file in the server and then let the user download it. This works just fine. But when multiple users try to do this, they must create their own copy of the file in the server. Can somebody suggest a foolproof way of naming the file - so that everyuser downloads only their copy of the file.
Many thanks in advance.
|
|
|
|
|
One of possibilities is:
string uniqueFileName = Guid.NewGuid().ToString();
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Hey Guys, Happy newyear. Just came back from the vacation and am glad to see so many replies. Many thanks for all of you.
I guess I will settle down with GUID.
tahnks once again, Blue_Boy.
|
|
|
|
|
You are welcome, I'm glad to help you.
Happy new year to you too.
Year happy = new Year(2010);
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
How about naming the file with the username as a part of it?
Or possibly a date-time-string such as 'yyyyMMddHHmmss' or a combination of the two?
Nah... What's up, Doc?
CCC's solved : 1
If a bus station is where a bus stops, and a train station is where a train stops, why do I have a work station on my desk?
|
|
|
|
|
Of course.. Pad the UniqueID(Preferably a GUID) just after the actual filename. It will identify which users copy of the file it is.
Also, if your requirement is only to have a copy, why dont you use Database as file storage. It is easier to manage files in database as far as your reqirement is concerned. Only a single row with UserID Foreign key will do the job for you.
Also, another thing, if the file wouldn't be modified by each user in the server, you dont have to store multiple copies of each file.
|
|
|
|
|
To Resolve this you can have a Small Function that will check if the File Exists , if so tell the user else create the File. Let the user be in control of the naming. This will make things easier for them because they will remember the names. Just add a Control Mechanism to check if the File exists with that name, if it exist Suggest another name.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
How to change the Legend Colour in SSRS. I need combination which are not there in Palatte
|
|
|
|
|
Just paste the color code it will work..!
like "#e9e9e9".It will work..!
If this is not your answer let me know..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hi all,
on clicking a button i am getting a following error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or
<%@ Page EnableEventValidation="true"
%> in a page. For security purposes,
this feature verifies that arguments to postback or
callback events originate from the server control that
originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation.
can any body guide me.......plz...
|
|
|
|
|
i set EnableEventValidation="false" in page directive and get solution to my prob...........
|
|
|
|
|