15,896,111 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Rohith Reddy Vadiyala (Top 14 by date)
Rohith Reddy Vadiyala
3-Oct-18 10:05am
View
we dont use any proxy. We have ADFS server and Hosted App server in different domains.
Rohith Reddy Vadiyala
3-Oct-18 8:57am
View
yes we have setup a ADFS serve which communicates with AD.
Rohith Reddy Vadiyala
30-Apr-15 8:52am
View
Deleted
Anjular code:
--------------------
var getFileDownloadData = function (dictName, inputParams) {
var deferred = $q.defer();
$http({
method: 'GET',
cache: false,
url: trideoConst.getUrl(dictName), // someurl/api/controller
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
}).success(function (data, status, headers) {
debugger;
var octetStreamMime = 'application/octet-stream';
var success = false;
// Get the headers
headers = headers();
// Get the filename from the x-filename header or default to "download.bin"
var filename = headers['x-filename'] || 'download.txt';
// Determine the content type from the header or default to "application/octet-stream"
var contentType = headers['content-type'] || octetStreamMime;
// var _data = headers['x-sourcefiles'];
try {
// Try using msSaveBlob if supported
console.log("Trying saveBlob method ...");
var blob = new Blob([data], { type: contentType });
if (navigator.msSaveBlob)
navigator.msSaveBlob(blob, filename);
else {
// Try using other saveBlob implementations, if available
var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
if (saveBlob === undefined) throw "Not supported";
saveBlob(blob, filename);
}
console.log("saveBlob succeeded");
success = true;
} catch (ex) {
console.log("saveBlob method failed with the following exception:");
console.log(ex);
}
if (!success) {
// Get the blob url creator
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
// Try to use a download link
var link = document.createElement('a');
if ('download' in link) {
// Try to simulate a click
try {
// Prepare a blob URL
console.log("Trying download link method with simulated click ...");
var blob = new Blob([data], { type: contentType });
var url = urlCreator.createObjectURL(blob);
link.setAttribute('href', url);
// Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
link.setAttribute("download", filename);
// Simulate clicking the download link
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
console.log("Download link method with simulated click succeeded");
success = true;
} catch (ex) {
console.log("Download link method with simulated click failed with the following exception:");
console.log(ex);
}
}
if (!success) {
// Fallback to window.location method
try {
// Prepare a blob URL
// Use application/octet-stream when using window.location to force download
console.log("Trying download link method with window.location ...");
var blob
Rohith Reddy Vadiyala
30-Apr-15 8:46am
View
Deleted
I'm trying to download pdf and doc files for now. They are able to download but cant be opened (like corrupt files).
Please help me where the issue is:
The following is the code in API controller:
--------------------------------------------
-> FileIOController
[HttpGet]
public HttpResponseMessage GetFileData([ModelBinder]List<string> inputparams)
{
var fileData = _fileUploadManager.GetFileData(3047);
if (fileData != null)
{
//return fileData;
HttpResponseMessage response = new HttpResponseMessage();
response.StatusCode = HttpStatusCode.OK;
response.Content = new ByteArrayContent(fileData.FileContent);
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = fileData.FileName
};
response.Content.Headers.ContentLength = fileData.FileContent.Length;
response.Content.Headers.Add("x-filename", fileData.FileName);
return response;
}
}
------------------------------------
angular JS Get Request
---------------------------
var getFileDownloadData = function (inputParams) {
var deferred = $q.defer();
//$http.get(http://sampleApi/api/FileIO,inputParams)
//$http.get(trideoConst.getUrl(dictName),
// { params: { '': inputParams } })
$http({
method: 'GET',
cache: false,
url: trideoConst.getUrl(dictName),
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
}).success(function (data, status, headers) {
debugger;
var octetStreamMime = 'application/octet-stream';
var success = false;
// Get the headers
headers = headers();
// Get the filename from the x-filename header or default to "download.bin"
var filename = headers['x-filename'] || 'download.txt';
// Determine the content type from the header or default to "application/octet-stream"
var contentType = headers['content-type'] || octetStreamMime;
// var _data = headers['x-sourcefiles'];
try {
// Try using msSaveBlob if supported
console.log("Trying saveBlob method ...");
var blob = new Blob([data], { type: contentType });
if (navigator.msSaveBlob)
navigator.msSaveBlob(blob, filename);
else {
// Try using other saveBlob implementations, if available
var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
if (saveBlob === undefined) throw "Not supported";
saveBlob(blob, filename);
}
console.log("saveBlob succeeded");
success = true;
} catch (ex) {
console.log("saveBlob method failed with the following exception:");
console.log(ex);
}
if (!success) {
// Get the blob url creator
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
// Try to use a download link
var link = document.createElement('a');
if ('download' in link) {
// Try to simulate a click
try {
// Prepare a blob URL
console.log("Trying download link method with simulated click ...");
var blob = new Blob([data], { ty
Rohith Reddy Vadiyala
30-Apr-15 1:58am
View
do you have any sample data which is a response to success method??
Actually the problem is I could able to download a file (pdf) but while opening it throws error in adobe reader: - "there was an error opening this document. the root object is missing or invalid"
Rohith Reddy Vadiyala
28-Apr-15 9:14am
View
I have shared the code that I started with.
any kind of help would be appreciated.
thanks in Advance.
Rohith Reddy Vadiyala
30-Oct-13 7:37am
View
Hi Zafar,
Thanks for the response. But what I'm actually looking for is " Importing Contacts with Google Authentication".
Which means I should navigate to google accounts page, login with gmail credintials and on success the contacts should be fetched.
Please help me in sorting this out.
Regards,
Rohith.
Rohith Reddy Vadiyala
28-Jun-13 7:03am
View
In our Application we use Infragistics Grid (IG-GRID) for which we will get data from DB tables and display it in the grid.
If there is no data in the DB table then a GRID without any records is displayed. But my requirement is to show a message like NO RECORDS FOUND in place of EMPTY GRID.
Is this can be done by using any of the predefined properties of Infragistics Grid.
If you knew it please let me know.
any kind of help is appreciated.
sorry if my english is poor..
Rohith Reddy Vadiyala
6-Apr-13 0:38am
View
Thanks @Moykn. Thanks for your suggestion..
Rohith Reddy Vadiyala
25-Mar-13 4:13am
View
Thank you for your Reply.. @Dave
Rohith Reddy Vadiyala
24-Mar-13 3:54am
View
yes, but can you please suggest me some alternative for my issue.
Rohith Reddy Vadiyala
7-Dec-12 6:35am
View
Is there anyone to help me..?
Rohith Reddy Vadiyala
7-Dec-12 1:38am
View
thanks for trying to help me pakh & CHill60.. I figured that my question is not useful for my requirement now. and I guess it's not clear..
Rohith Reddy Vadiyala
6-Dec-12 10:32am
View
my task is to import the data in EXCEL to tables in DATA BASE(SQL). each row in the excel sheet will have some multiple columns with same column names and some with distinct column names. now I need to insert all the multiple columns with same column names into a table and the other columns into another table.
Show More