|
Ex:
If I send user the download url like http://www.mysite.com/downloads/file1.pdf
but there are file2.pdf,file3.pdf in the same folder and user can simple rename the file1.pdf to file2.pdf in the url and he can download file2.pdf.
How can we restrict users from doing this.
I really appreciate for you help....
Thanks
Nani
|
|
|
|
|
First, you would need to have the user login.
Then using the associated cookie/token have permissions associated with those files.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Another answer would be to make the names of the files hideously complicated and non sequential.
Thus if he wanted to load the first file, 'File1' then fine, but he would presume that the second file would be 'File2' not 'DannyBoyK4ZqZarniwoop' or some such thing.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hello,
I've been working on a demo application in C# (with .NET 4.0) and I need to implement database functionality in a way that imposes few requirements/burdens for the user. Essentially I want to use database file based functionality (I must use SQL for the project). So far I began using Compact but had trouble all the time with the Entity Framework. Essentially what I expect is to either manually or graphically design the database model, have it automatically applied to the db file or Express local server and so on.
I switched to Express and I've been unable to see the database file attached to the server. Essentially I can only create a dbo real database in the server, and attaching a file doesnt work.
It would be perfect to be able to use the model automatically via classes, so you can access things like Users.SomeRelationshipItems, RelationshipItem.User, etc.
Any help would be appreciated.
|
|
|
|
|
By mentioning that you are trying to attach to a DB file I assume this is not a distributed application; users will be using a database installed on their PC.
If that is the case, try SQLite. It should be perfect for the job. You will need a management tool, SQLite Maestro is one of the better ones, handles relational integrity etc. You'll also need to install SQLite.NET to interact with the SQLite data adapters.
"You get that on the big jobs."
|
|
|
|
|
Hi,
Can anyone please tell me the advantages of using Restful service in MVC Framework.
Thanks in Advance
|
|
|
|
|
Your question is a bit too broad there. You might want to clarify what you are asking - are you asking why you'd want to use REST in general, or whether it has advantages in MVC over other forms of connectivity? Or are you asking for guidelines on how to write RESTful services properly?
|
|
|
|
|
My manager has asked me to use Restful service in my MVC application.I would like to know whether it has any advantages if we use in MVC application.
|
|
|
|
|
If he's told you to use it, then why bother debating?
Yes, REST is very useful - the new WCF RESTful services are a thing of beauty.
|
|
|
|
|
Its not about debating...I would like to know the advantages..thats it..
Thanks for your response
|
|
|
|
|
have a read[^] of this article. It explains the "whys and wherefores" pretty well.
|
|
|
|
|
harinit wrote: My manager has asked me to use Restful service in my MVC application.I would like to know whether it has any advantages if we use in MVC application.
Well based on that statement I would guess that there is no advantage.
Now it could be that your manager is smart, does a lot of research, does a lot of business analysis and then hands down decisions based on that to those under him/her without one mention of why a particular choice was made.
That wouldn't really reflect well on that persons ability to manage however.
But there is certainly a chance that it is just the buzzword of the week.
|
|
|
|
|
Hello There,
I have a winform application in Visual Studio 2010 and within a class I have a shared function with the following code
Public Shared Function simplestFunctionEver() as Integer
Dim myInteger1 As Integer = 1, myInteger2 As Integer = 2
simplestFunctionEver = myInteger1 + myInteger2
End Function
While debugging or otherwise, How can I test this function in Visual Studio 2010
Regards & Thanks in advance to users who reply
Farooq
|
|
|
|
|
Why would you want to, it doesn't do anything. Testing a method that takes in no arguments and returns nothing while also not changing or calculating anything external from the method is pointless.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Thanks for replying. The objective of my question was not the function but the method on how one can do this in Visual Studio 2010. I can use the same function to do complex formatting and addition of time by converting it to text etc and then wishing to see what the result would look like is a legit question
Regards
|
|
|
|
|
Marcus Kramer wrote: and returns nothing
Assigning a value to the functions' name is an antique syntax for returning that value.
Bastard Programmer from Hell
|
|
|
|
|
You could:
- single-step the code (not my favorite)
- exercise the code by having it called, any way you like
- execute unit tests (see NUnit)
- have an external company validate your implementation against your requirement specifications
- integrate it in a bigger app and observe (and maybe wonder why and how it is failing).
|
|
|
|
|
You can use the VSTS test project of VS2010 to create and execute to verify
or call this shared function via some other method.
|
|
|
|
|
Hello There,
Thanks for replying. Can you please clarify or guide me as to what VSTS Project is and how exactly can I call this type of function in there
Regards & Thanks
|
|
|
|
|
|
Member 3357336 wrote: While debugging or otherwise, How can I test this function in Visual Studio 2010
You can only debug one thing at a time. What does "test" mean here? You could add a watch to show it's return value during debugging
Bastard Programmer from Hell
|
|
|
|
|
Thanks for replying. "Test" simply means that I want to call this function and debug it's guts. Please note that users in this forum are taking this function literally. It's not the attributes of the function I am interested in but the way this could be debugged in VS2010. I could have a very "Generic", (shared) extremely lengthy format or compute function that I want to debug
I am still not sure on how to do this so please help
Regards
P.s. I really don't want to call this function while executing my complete program and calling with a button or anything similar. Simply go to a screen call the function and be able to debug it
|
|
|
|
|
The accepted way to test functions is to write unit tests, which you can call using test harnesses. There are whole books out there on the subject; what you really want to look at is unit testing c# and test driven development.
|
|
|
|
|
Thanks. This is exactly what I wanted to know. I simply created a unit test and that did it for me
Regards & Thanks to all who replied
|
|
|
|
|
You're welcome. Glad to be of service.
|
|
|
|