|
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...........
|
|
|
|
|
|
|
I have used the option of the better methods from this document http://msdn.microsoft.com/en-us/library/system.web.ui.sessionpagestatepersister.aspx[^]
PageStatePersister _pers;
protected override PageStatePersister PageStatePersister
{
get
{
if (_pers == null)
_pers = new SessionPageStatePersister(this);
return _pers;
}
}
Everything works great, the viewstate is no longer on the page and is moved to session. But how does this get released from the session. I don't see it released and my servers cpu memory is growing indefinetely.
Thanks,
Tilak
|
|
|
|
|
Who told you that using SessionPageStatePersister is a better technique to hold page data.
I think it is better to have viewstate in hiddenfield using HiddenFieldPageStatePersister which is default. I think Everyone here will accept this(Even microsoft do think this, thats why they placed it as Default)
Using excessive session is not a good idea. Actually Session is cleared only when Session TimeOuts, or you manually clear the Session during Logout Request / or anywhere. PageStateAdapter can just refresh the Session Page state on every request.
Dont load lots of Data in one single Application Pool. This will endanger your site if large no of request is made to the site.
If possible, try to minimize the Viewstates transferred to the page.
|
|
|
|
|
The idea here is eventually to move the session to sql server in a load balanced enviroment. Having the viewstate on the page is breaking in a load balanced enviroment.
Thanks for your reply
-Tilak
|
|
|
|
|
Well... moving Inprocess session to StateServer will make your site 10 - 25% slower. Storage of Complex DataTypes will make it even slower.
Normally we do this when we have multiple servers for the same site, which makes it impossible to have session in one process.
So if you are not having multiple web server, storing viewstate to SQL server will reduce performance...
|
|
|
|
|
Hi Abhi,
Exactly the point, we are trying to loadbalance our website to a web farm architecture and don't want the viewstate on the page.
Also most of our screens are transactions which are carrying a viewstate of around 300k on an average and use a lot of partial postbacks and we are looking at options of minimizing data turnaround on each postback(partial or full) between the client and server as the server is planned to be sitting in a remote location in India. So I tried the above approach and got stuck at a point the session grows indefinitely, although eventually I plan to move the session to sql server but wanted to close this minor yet critical hole in the design. I was also thinking when they have an object made available like that they would have taken care of this memory release and may be I am missing something and the answer would be staight forward, but apparently not.
Although viewstate serialization and transfer can put additional burden of 10 to 25% as you said, in my case I want to explore this option, as each partial postback is taking seconds to process when the server is remote as opposed to local which is way faster.
Do you know any good performance test tools which will be helpful in my case above.
Thanks and really appreciate your time,
Tilak
|
|
|
|