How to create a file in Windows that would have attributes FILE_ATTRIBUTE_TEMPORARY and FILE_FLAG_DELETE_ON_CLOSE set using Java?
I do want my file to be just in-memory file.
We have a project coming up where we will be building a whole backend CMS system that will power our entire extranet and intranet with one package. The question I have been trying to find an answer to is which is better: storing images in the database (SQL Server 2005) so we may have integrity, single replication plan, etc OR storing on the file system?
One issue we have is that we have multiple servers load balanced that require to have the same data at all times. As of now we have SQL replication taking care of that but file replication seems to be a little tougher. Another concern we have is that we would like to have multiple resolutions of the same image, we are not sure if creating and storing each version on the file system would be best or maybe dynamically pulling and creating the resolution image we would like upon request.
Our concerns are the with the following:
Data integrity
Data replication
Multiple resolutions
Speed of database vs file system
Overhead load of database vs file system
Data management and backup
Does anyone have a similar situation or have any input on what would be recommended? Thanks in advance for the help!
Hi everybody!
Im working on a asp.net 3.5 web application (C#), where i have a file with some information that is updated frequently, and only few accounts can access to it (the application is using the asp.net authentication system, stored in a SQL database).
My task is to parse that file, so i made a small parser (another web app) a to show the information in a more friendly way.
However, everytime i want to parse it, i need to enter in the application with one of those accounts, download the file, put in the parser's folder.
Is there any way to, given the username and password, download the file directly from the parser application and use that one?
Thanks in advance
I'd like if someone could give me some advice on creating the php file, i know to php language.but where to write it.i have followed some tutorial to run php file in netbeans but its pathethic to download xamp server,apache http server.can u give me the direct of how make configuration and all.i have window7 ultimate and will file i hav to download i don't know. i have netbeans all bundle feature and wamp server.how should i write my php program successfully.plz help me to resolve this.
hai..
Am writing application for capture video from camera in vc++ using directshow and write that
file in WMV format.and how to write MPEG4 file format.can i install any sdk for mpeg4.can you provide details about mpeg file writing in vc++
kindly help me
thanks
Hi,
I am trying to parse one XML file that contains some unicode characters.I tried to parse the file using NSXMLParser but i am unable to parse XML.Parser stops when it encounters any unicode characters.
Is there any other good solution to parse XML file with unicode letters?
Please suggest.
Thanks,
Jim.
How can I save an image safely from a fileinput field using PHP & MySQL?
Here is the inputfile field.
<input type="file" name="pic" id="pic" size="25" />
Hi!
Is it possible to cut audio file with iPhone SDK? (file has .caf extension)
I just need to cut off the silence at the beginning.
(Also, maybe it's possible to write new file from the existing one with specified start and end time.)
Thanks in advance!
Hi Everyone,
I found the following code to check if a file exists on a server, but is not working for me. It tells me that "test1.tx" does not exist even though the file exists and its size is 498 bytes.
If I try with Ftp.ListDirectory it tells me that the file does not exist.
If I try with Ftp.GetFileSize it does not provide any results and the debugger's immediate gives me the following message: A first chance exception of type 'System.Net.WebException' occurred in System.dll.
Using "request.UseBinary = true" does not make any difference.
I have posted this same question at this link: http://social.msdn.microsoft.com/Forums/en-US/ncl/thread/89e05cf3-189f-48b7-ba28-f93b1a9d44ae
Could someone help me how to fix it?
private void button1_Click(object sender, EventArgs e)
{
string ftpServerIP = txtIPaddress.Text.Trim();
string ftpUserID = txtUsername.Text.Trim();
string ftpPassword = txtPassword.Text.Trim();
try
{
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://" + ftpServerIP + "//tmp/test1.txt");
request.Method = WebRequestMethods.Ftp.ListDirectory;
//request.Method = WebRequestMethods.Ftp.GetFileSize;
request.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
//request.UseBinary = true;
using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
{
// Okay.
textBox1.AppendText(Environment.NewLine);
textBox1.AppendText("File exist");
}
}
catch (WebException ex)
{
if (ex.Response != null)
{
FtpWebResponse response = (FtpWebResponse)ex.Response;
if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
{
// Directory not found.
textBox1.AppendText(Environment.NewLine);
textBox1.AppendText("File does not exist");
}
}
}
}
Thanks very much,
xplorer2k
Hello:
I am using the following tcl code to store a file from my deskstop into a Sqlite database as blob data ($fileText is a path to a text file):
sqlite3 db Docs.db
set fileID [open $fileText RDONLY]
fconfigure $fileID -translation binary
set content [read $fileID]
close $fileID
db eval {insert into Document (Doc) VALUES ($content)}
db close
I have found many resources on how to open the blob data to read and write to it, but I cannot find any resources on openning the blob data as a file. For example, if $fileText was a pdf, how would I open it, from Sqlite, as a pdf?
Thanks,
DFM
So I got this code
Javascript:
<script type="text/javascript">
$(function(){
$('.ajax') .click(function(e){
e.preventDefault()
$('#content').load( 'file.htm' )
})
})
</script>
html:
<a href="file.htm" class="ajax">Link</a>
it works perfectly in firefox, but nothing happens when I click the link in chrome and IE simply opens a new window with the file. any advice?
Hi..
By setting the bellow properties we can create the setup file automatically uninstall existing setup and install new setupfile.
DetectNewerInstalledVersion:True
RemovePreviousVersion:True
But each and every setup file we need to change the version property of Setupfile. If it is, it won't through error while installing current setupfile otherwise
it throws error: already installed.
I am looking into how we can create the setup file without changing the version property of existing setupfile.
Thanks.
I've installed dotless and i see the handler has been added to my web.config file. However, i am unable to make changes to the .less file dynamically and reload the page and see the effect of the changes...Is there some setting I need to turn on? This is the handler:
<handlers>
<add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
</handlers>
For some reason I cannot get cPickle.load to work on the file-type object returned by ZipFile.open().
If I call read() on the file-type object returned by ZipFile.open() I can use cPickle.loads though.
Example ....
import zipfile
import cPickle
# the data we want to store
some_data = {1: 'one', 2: 'two', 3: 'three'}
#
# create a zipped pickle file
#
zf = zipfile.ZipFile('zipped_pickle.zip', 'w', zipfile.ZIP_DEFLATED)
zf.writestr('data.pkl', cPickle.dumps(some_data))
zf.close()
#
# cPickle.loads works
#
zf = zipfile.ZipFile('zipped_pickle.zip', 'r')
sd1 = cPickle.loads(zf.open('data.pkl').read())
zf.close()
#
# cPickle.load doesn't work
#
zf = zipfile.ZipFile('zipped_pickle.zip', 'r')
sd2 = cPickle.load(zf.open('data.pkl'))
zf.close()
Note: I don't want to zip just the pickle file but many files of other types. This is just an example.
In this script I have problems with file-name-extensions:
if I use /home/mm/test_x it works, with file named /home/mm/test_x.csv it doesn't:
#!/usr/bin/env perl
use warnings; use strict;
use 5.012;
use DBI;
my $table_1 = '/home/mm/test_1.csv';
my $table_2 = '/home/mm/test_2.csv';
#$table_1 = '/home/mm/test_1';
#$table_2 = '/home/mm/test_2';
my $dbh = DBI->connect( "DBI:CSV:" );
$dbh->{RaiseError} = 1;
$table_1 = $dbh->quote_identifier( $table_1 );
$table_2 = $dbh->quote_identifier( $table_2 );
my $sth = $dbh->prepare( "SELECT a.id, a.name, b.city FROM $table_1 AS a NATURAL JOIN $table_2 AS b" );
$sth->execute;
$sth->dump_results;
$dbh->disconnect;
Output with file-name-extention:
DBD::CSV::st execute failed:
Execution ERROR: No such column '"/home/mm/test_1.csv".id' called from /usr/local/lib/perl5/site_perl/5.12.0/x86_64-linux/DBD/File.pm at 570.
Output without file-name-extension:
'1', 'Brown', 'Laramie'
'2', 'Smith', 'Watertown'
2 rows
Is this a bug?
Hi everyone,
I have an array of file names which I want to download.
The array is currently contained in a string[] and it is working inside of a BackgroundWorker.
What I want to do is use that array to download files and output the result into a progress bar which will tell me how long I have left for completion.
Is there a way I can do this.
Thanks.
The history view of eclipse shows you a list of files changed in a certain revision. When you open the context menu on one of these you have the option 'Open' which opens a view of that file in that revision.
How can I open the editor for the selected file, i.e. the file in the version of the working copy, right from the history view?
Background is that I want to use the history view to find files that have been changed recently to do code reviewing. People commit via subversion and I use subclipse to connect eclipse to the subversion server.
Today, I must use the 'Open resource'/'Open type' function and type the name of the file that I can read from the history view.
I received a "Too many open files" error when tried to do fopen (C++, Windows XP).
Probably it happened because somewhere in my program I open files without closing them.
Is there a way on Windows to see a list of all open file descriptors (or all files that my program fopened)?
I have created a windows application setup program, it needs to have a text file in the application folder. The file is also included while creating the setup.
Once the setup successfully completes and my program tries to modify the file based on user input, its simple throwing an exception.
I am using Windows 7 Home Premium OS.
Any suggestion/help will be great to overcome this issue.
I go to xcodepreferencesfile_types, change association for file type "xyz", click apply+ok, reopen xcodepreferencesfile_types, check association for file type "xyz", its set as I just edited it.
Not I quit xcode, start it again, xcodepreferencesfile_types, check association for file type "xyz", and its getting reset to its old value just like i never edited it.
This is so lame, kindly suggest something :(
I have a bash script that runs on our shared web host. It does a dump of our mysql database and zips up the output file. Sometimes the mysqldump process gets killed, which leaves an incomplete sql file that still gets zipped. How do I get my script to 'notice' the killing and then delete the output file if the killing occurred?
Hi,
I have added new Xib view file in my project. I assigned to view controller and in the view controller I set:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
return YES;
}
But when the application runs in landscape mode, xib is not in landscape mode. I have set in info.plist file also xib file is also in landscape view. What do I have to do? Any help?
A common file may be used in one more projects and such files will be shown as a linked file in VSS database. Actually such files are kept at a unique location within the database. Is there a way to get the original storage location of a linked file ?