i create a simple mvc3(razor) web application and want to use it "for my customers to download files from my site".
it works fine on local host but when i upload it on my host when user press download button the browse dialog box come up to download it can not realize file tipe and say unknown file and remove file extension for example :
"test.rar" will convert to "test" with no file extension.
i tested it on Firefox 12 and ie8 they show one behavior.
please help me
my code:
public ActionResult down(string id)
{
return File(#"c:\test.rar", "rar", "test.rar");
}
Try to change content type to application/x-rar-compressed or application/octet-stream.
Related
OS: Windows 10
I have installed TestLink(testlink-1.9.15) and Mantis(mantisbt-1.3.3) on XAMPP successfully. Both of them can be launched in browser separately.
I want to integrate Mantis with TestLink. To do this I followed the doc "tl-bts-howto.pdf" which is located at \testlink\docs folder. In that PDF I found the following lines to configure Mantis in TestLink:
Step 2 – Test Link – Configure Mantis interface
Edit file /cfg/mantis.cfg.php
But, unfortunately I did not find any file named "mantis.cfg.php" in cfg folder of TestLink.
What can I do? Is there any way to configure/integrate Mantis with TestLink?
Prerequisite: Successful installation of XAMPP
Install and configure TestLink and Mantis on XAMPP
Browse TestLink on a browser and log in (In my case it was http://localhost:8077/testlink/ )
Click "Issue Tracker Management" link at the left
Click Create button -> Enter a Issue Tracker name as your choice (I inputted as "mantis - (Interface:db)")
Select "mantis (Interface: db) from the Type drop down and enter the text in Configuration text area mentioned in screenshot attached herewith.
Lastly click Save button to save
Note: In the above configuration text, be specific for individual information. It may vary person to person.
You can get the configuration example by clicking "Show configuration example" link
mantis.cfg.php is not part of Mantis. You can see this in the testlink source.
I downloaded the zip OpenNTF-Domino-API-2.0.0 locally and unzipped it. According to the documentation that I have been able to find there should be two updatesite databases --one for the server and one for the designer, but they do not appear to be in the download.
I unzipped the UpdateSite file and get a site.xml file and was able to add that to my updatesite.nsf on my server. But I do not see how to update the designer. All of the documentation/demos that I have found refer to an update-Designer.nsf .
How do you install it to the designer client??
Follow the steps in this presentation: http://www.slideshare.net/OliverBusse/utilizing-the-openntf-domino-api. The steps to install in Domino Designer are on slide 16 and added here for future reference:
Open DDE‘s preferences
Goto „Domino Designer“ section
Activate „Enable Eclipse plug-in install“
Open the update site NSF you just created
Goto „Actions, Show URLs“
Copy one of the two URLs to clipboard
Goto „File, Application, Install“
Choose „Search for new features to install“
On the next screen „Add (a) Remote Location“
Enter a name for it and paste the URL in the clipboard
On the next screen check the ODA entry and click next/yes if you are asked to
I am using Visual Studio 2013 to create a Visual Basic application. I am using a web browser named mail
When I use the Navigate function, it will go to the php page, but then it won't show the results like it does a with normal browser. Instead, it tries to download a JSON file.
This is the command I am using in mail:
mail.Navigate("http://api.guerrillamail.com/ajax.php?f=get_email_address&ip=" & ReturnIP() & "&agent=VBProject")
If you go to this URL in the Visual Basic project, it will try to download ajax.json. However, if you go to it in a normal browser, the JSON file is displayed on the page, and it looks like:
{"email_addr":"hoppoxyn#guerrillamailblock.com","email_timestamp":1400779801,"alias":"dcoipje+wwy9y0","sid_token":"4fqkl2q9mlp4uvgki5fkckk4q3"}
Is there a way to do this in Visual Basic? I added a reference to JSON.NET to my project.
Visual Basic runs the test environment in IE7. To accomplish this you need to make changes to your registry.
Open Notepad and paste the following:
Windows Registry Editor Version 5.00;
; Tell IE 7,8,9,10,11 to open JSON documents in the browser on Windows XP and later.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place" .
;
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00
Save the file as IE-Json.reg
Remember to always back up your registry before making changes
Run IE-Json.reg
I created from scratch a cloud app located at:
http://jimszend.my.phpcloud.com/
I have zero files on my local drive, but I am trying to get them from the server using Zend Studio.
I have found this page to accomplish this but it does not work:
http://www.phpcloud.com/help/studio-remote-system
Step 1. I believe to be correct. But I have no way to know for sure.
Step 2. Open the PHP or Zend Framework project that you want to upload to your application container, or create a new project. <--- I want to create a new project on my hard drive.
So Step 2 somehow does not work, so instead I go to File -> New -> PHP Project from Zend Developer Cloud.
So I give the project a name: say ABC
The location is: C:\Users\Jim\Zend\workspaces\DefaultWorkspace
The container from a dropdown is: http://jimszend.my.phpcloud.com:10082 (Id: 4_0 )
Now I click refresh right below that and I get nothing so now I click on Add Target
and I enter a username and password. This dialog screen is the problem. I can't figure out what to enter here. meaning I have tried hundreds of different ways and I get stuck right here. I always end up clicking on Generate new key and then I click Test Connection and since there is no error, I assume this is correct.
Then I close that screen and now when I click on the drop down for Application nothing gets filled in. But sometimes this does work and I find my application which says, "jimszend zend framework" - something like this, but even if I get this far then I get some sort of Git failure when I click finish.
Does anyone know a full proof way to pull down "my files" using Zend Studio from PHP Cloud?
Thanks,
Jim
I suspect you may not have your public / private keys set or somewhere you are not supplying the correct credentials during the process. I did the following.
Follow this help document very closely. It's a really good doc from the phpcloud people.
http://www.phpcloud.com/help/putty-ssh-debug-tunnel
Using the phpcloud admin I created a new public / private key pair (Zend Studio kind, ending in .pem). Then I downloaded the .pem to a folder on my windows 7 machine.
Next download from the putty website these three applications to help you match your private / public key pair in putty and in Zend Studio. For me I wanted everything hooked up, both Putty and Zend Studio.
-PuttyGen
-Pageant
-Putty
Note putty uses a .ppk file type (not .pem), so Using PuttyGen I opened the .pem file and saved out the private key to the same location where I saved my .pem file from the php cloud. I kept the same file naming convention, to keep matters straight. So the only difference between the two files was .pem and .ppk.
Next I opened Pageant and used Pageant to open a store my .ppk file. I understand Pageant to be a key store which Putty will check, as it needs to open locked doors.
Next I followed the guidelines in the above phpcloud link, carefully, to establish a tunnel.
Once the tunnel was open, I launched Zend Studio.
From there I went to Windows->preferences and searched for SSH2. Once the SSJ2 dialog opened, under the general tab I added both my .pem and .ppk to the path. Then under the Key Management tab dialog I used "Load existing key" and loaded my .pem file. Then I clicked apply.
Then using Zend Studio I created a new "PHP Project from Remote Server". I went though the steps clicking "Manage remote servers". For the server connection I typed the follow.
JAZZFINGERS.MY.PHPCLOUD.COM
and if you are prompted for credentials, do not use the container credentials, unless they are the same as your other credentials.
From there you can also test your connection. For me this worked. Hope this helps. Oh yeah, also read this. Very important and helpful.
www.phpcloud.com/help/studio-remote-system
-Best Wishes
My windows mobile app has a local database file (database.sdf). The file that is created when the user installs the CAB file in their device. The installation works fine but when I try to open the SDF with Query Analyzer or when the app tries to access the database I get a message.
"Access to the database file is not allowed" (25039)
When I checked the permissions using Windows Explorer (the device is docked), the file is marked Read Only. If remove the Read Only checkbox everything works fine, I can open, edit and add records to the database.
How I can make the file not Read Only by default?
You could verify the attribute programmatically during start-up of your application. In C#/.netcf it would be:
if (File.GetAttributes(path) & FileAttributes.ReadOnly == FileAttributes.ReadOnly)
File.SetAttributes(path, File.GetAttributes(path) & ~FileAttributes.ReadOnly);
In addition to the answer provided by yms, I would try to figure out why the file is being created as ready-only in the first place.
Is it created via some custom installer dll you added to the installation process? Or is it packaged up into the .CAB file via cabwiz or an installer project in VS?
If it's the former, check the source code of that installer library.
If it's the latter, check the source files. If you include the SDF in your Visual Studio project and have the project checked into some type of source control, it's likely that while it's checked into the source repository it's read-only on disk when it get's packaged up into the .CAB.
I know this is old, but if Andrew is actually using the .netcf, it doesn't have File.GetAttributes. Instead he should use
FileInfo info = new FileInfo(pathToFile)
if ((info.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
info.Attributes &=~ FileAttributes.ReadOnly;