SQLConnection.attach() fails when file path contains apostrophe
Hello,
Any help on this would be much appreciated. Issue occurs when user has apostrophe in their windows username and therefore an apostrophe in their File.applicationStorageDirectory path.
e.g. if the user logs into windows as j.o'reilly, then it will be:
C:\Documents and Settings\j.o'reilly\Application Data\application name\local store
Have tried with Air Runtimes: 2.5.0.16600,2.6.0.19120,3.2.2070
Have tried with Air SDKs: 2.0, 2.7, 4.5
To replicate without creating a windows user with an apostrophe, the same result occurs if the files themselves are named with an apostrophe:
var __connection:SQLConnection;
__connection = new SQLConnection();
__connection.open( File.applicationStorageDirectory.resolvePath("mainfile.s3db"), SQLMode.UPDATE );
__connection.attach( "secondary", File.applicationStorageDirectory.resolvePath("user'name.s3db") );
Result:
SQLError: 'Error #3125: Unable to open the database file.', details:'near 'name': syntax error', operation:'attach', detailID:'2003'
at flash.data::SQLConnection/internalAttach()
https://bugbase.adobe.com/index.cfm?event=bug&id=3220380
Community support? You mean I can checkout the source of flash.data.SQLConnection and fix it? Can you please post the repo url?
The workarounds we attempted involved escaping the apostrophe were defeated by the File class removing the escaping.
//Attach() Does not accept strings
File.applicationStorageDirectory.resolvePath(sqliteFileVO.fileName).nativePath
//Attach will not work with files which have their path escaped DOS style
var f:File = new File( '"' + File.applicationStorageDirectory.resolvePath(sqliteFileVO.fileName).nativePath + '"');
//Passing as url does not escape the apostrophe
var f:File = new File(File.applicationStorageDirectory.resolvePath(sqliteFileVO.fileName).url);
//passing using url notation does not escape the apostrophe
var f:File = new File("app-storage:/"+sqliteFileVO.fileName);
//Escaping the native path this way means the file cannot be found
f.nativePath = f.nativePath.replace(r,"%27");
//Escaping the native path this way does not work
f.nativePath = '"'+f.nativePath+'"';
//cannot be escaped with \ or / they will be interpreted as separator
//you may pass in escaped file path, but File will unescape it for us immediately
var regfind:RegExp = /'/g; //'
var strreplace:String = "%27";
var strclean:String = fileName.replace(regfind,strreplace);
file = new File("app-storage:/"+strclean);
Similar Messages
-
Desktop.open() fails when file contains German umlauts
Hello,
I want to open a file using the Desktop-API:
// check whether opening a file is supported or not
if (!desk.isSupported(Desktop.Action.OPEN)) {
// display error message box
JOptionPane.showMessageDialog(getFrame(),getResourceMap().getString("errLinkUnsopportedMsg"),
getResourceMap().getString("errLinkUnsopportedTitle"),JOptionPane.ERROR_MESSAGE);
return;
desk.open(linkfile);I'm catching all possible exceptions here:
catch (IOException e)
catch (IllegalArgumentException e)
catch (SecurityException e)
catch (UnsupportedOperationException e)
catch (URISyntaxException e)But when I want to open a file that contains German umlauts, my application throws following exception:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException:
Non-Java exception raised, not handled!
(Original problem: *** -[NSCFArray initWithObjects:count:]:
attempt to insert nil object at objects[0])
at apple.awt.CDesktopPeer._lsOpen(Native Method)
at apple.awt.CDesktopPeer.lsOpen(CDesktopPeer.java:53)
at apple.awt.CDesktopPeer.open(CDesktopPeer.java:33)
at java.awt.Desktop.open(Desktop.java:254)
at zettelkasten.ZettelkastenView.eventHyperlinkActivated(ZettelkastenView.java:9609)
at zettelkasten.ZettelkastenView.access$6000(ZettelkastenView.java:119)
at zettelkasten.ZettelkastenView$14.hyperlinkUpdate(ZettelkastenView.java:7014)The file does definitely exist. I chose it with a filechooser, and I debugged the source step-by-step. Before calling the desktop.open() command, I check whether the file exists or not (File.Exists()).
When I open any file without umlauts, everything is fine. Only files with umlauts in their filename seem to make trouble.
My OS is:
Mac OS X 10.5.5, running the latest Java 6, using NetBeans 6.5
Is there any solution, or at least a workaround?
Thanks in advance!
Daniel
Edited by: DnlLdck on Jan 29, 2009 6:23 AMSame thing happened to me, but I was trying to browse an URI which contains non-English characters. Haven't try it on Windows yet. Maybe it does not support non-English characters on Mac.
-
File Path contains the token "bc-"
We recently upgraded to the RoboHelp version 9 and are finding a critical problem within all generated html files. It seems RoboHelp is inserting a new script in every html file which we would like to either modify or remove. The snippet of this script is given below.
Our problem is that we have stored these files in a path that has this token “bc-“ - C:\projects\{705e5340-460b-11e1-b8bc-0800200c9a66}.
We need your help to either modify this token or remove this check from all project files.
SNIPPET:
========
if (window.gbWhTopic)
var strUrl = document.location.href;
var bc = 0;
var n = strUrl.toLowerCase().indexOf("bc-");
if(n != -1)
document.location.href = strUrl.substring(0, n);
bc = strUrl.substring(n+3);Hi,
Peter and I have been looking into this problem and here's what we found:
RH sometimes adds bookmarks in the top of topics called “bc-x” This is done because a topic can be used in the TOC multiple times. But based on the item selected in the TOC, the topic needs display a different breadcrumb path. The script uses a link to the bc-x bookmark to determine which breadcrumb path to show.
When the topic is opened without the skin showing, the script will try to reload the topic by simply removing the link to the bc- bookmark:
http://example.com/myfile.htm#bc-1
becomes:
http://example.com/myfile.htm#
The script doesn't try to redirect when you open the topic with the skin showing, such as: startpage.htm#target.htm#bc-1
Af far as I can make out, I think it will be safe to simple remove the line
document.location.href = strUrl.substring(0, n);
from your output. Although I couldn't find another use for this besides the breadrumbs, I can't say for sure what other impact removing the line may have. You can try removing the line to see whether it works. NOTE: if you find a new issue that surfaces because you removed the line, I doubt that anyone on the forum will be able to help. Sorry, but we are only users like yourself.
Having said that, you can use a find and replace tool such as FAR to quickly remove the above mentioned line from your output files. Alternatively, you can create a script to do that for you.
I think Peter's advice is sound: do take this up with Adobe Technical Support and/or report this as a bug: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
Greet,
Willam -
Csv upload fails when the header contains colon (:)
Hi,
There seem to be a problem with the csv upload to the database tables. If the column header of the csv file contains colon the process fails.
Please help!!
MustakHi Andy,
Thanks! The APEX version is 2.0. I have developed an application where I uploading models and their features from the csv file. The csv file headers are models names, feature names etc and the rows are models and their corresponding features. Some of the features(as headers) contains colons such as "3:2-pulldown compensation", a feature of TV. The upload process reads the models and features and load the feature values to the appropriate table. So you can imagine the column headers are important for the process. I wander if there is any work around.
Mustak -
Connection Failed when File Sharing and High CPU Usage
I have a small wired network where a G5 Tower (10.5.8) has an external drive connected via FW800 set as shared so it can be accessed from a C2D iMac (10.6.4). This has been working great since it was setup in Feb.
Today the iMac was unable to access the G5. It didn't show either the Public folder on the G5 or the shared FW drive. When clicked it showed "Connection Failed." Immediately the G5 spun up to 100% CPU usage. Activity monitor showed AppleFileServer as the culprit, and when quit, resumed to normal usage.
Same happens when trying to access the G5 from a Mac Mini (10.5.8)
Once the iMac gave a warning of something like: "Failed to connect because there are too many users." Which is rubbish because no one was connected or could connect, and this was verified in the Sharing Pref Pane.
I've tried restarts, disk repairs off a boot disk, and enabling / renabling File Sharing. The G5 can connect to the other macs, and they to each other, just not to the G5.
Anyways, any help is much appreciated. Thank you.So somehow I got the computers to connect to the G5 with file sharing. I went through a bunch of steps, and not really sure what worked.
I believe it had something to do with the 'Public' user folder only being listed in the file sharing pane, instead of the User folder. Why that would also stop the shared external drive from being seen, I'm not sure. -
Background job - failing when file not on app server
Hi Experts,
I am facing an issue, while I am trying to run a program in background.
Let me explain u the situation.
My program runs in background and pick one file from predifined folder from application server and process that file. if file is not in the folder batch job goes into cancel status. but what i want if proposed file is not available then batch job will run and finished; it should not go into cancle status.
waiting for valuable inputs,
Prarthan.
Edited by: Julius Bussche on Feb 20, 2009 1:06 PM
Please use meaningfull subject titleshi
below is my piece of code for application server.
thanks.
FORM application_server .
TYPE-POOLS: kcde.
DATA : lt_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
DATA wa_src01 TYPE string.
DATA: BEGIN OF wa_src0,
material LIKE bapi2017_gm_item_create-material,
consumption_qty(13) TYPE c," like bapi2017_gm_item_create-entry_qnt,
base_uom LIKE bapi2017_gm_item_create-entry_uom_iso,
movement_type LIKE bapi2017_gm_item_create-move_type,
cost_center LIKE bapi2017_gm_item_create-costcenter,
doc_date LIKE bapi2017_gm_head_01-doc_date,
post_date LIKE bapi2017_gm_head_01-pstng_date,
plant LIKE bapi2017_gm_item_create-plant,
storage_location LIKE bapi2017_gm_item_create-stge_loc,
END OF wa_src0.
DATA : lt_src0 LIKE TABLE OF wa_src0.
DATA : file1 TYPE string.
DATA : tmp0(20). " type string.
DATA : intern1 TYPE kcde_intern.
DATA : tmp_date LIKE sy-datum.
path1 = path.
replace '.txt' in PATH1 with ''.
IF path IS INITIAL.
path = '/usr/local/interface/globalone/SFA/SFA_WORK/SFA_'.
tmp_date0(2) = sy-datum6(2). "date dd
tmp_date2(2) = sy-datum4(2). "month mm
tmp_date4(4) = sy-datum0(4). "year yyyy
CONCATENATE path plant tmp_date '.txt' INTO path.
concatenate path tmp_date into path1.
ENDIF.
file1 = path.
file_nm = path.
FILE_NM2 = PATH1.
OPEN DATASET file_nm FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.
IF sy-subrc NE 0.
MESSAGE e000(zmm002).
EXIT.
ELSE.
DO.
READ DATASET file_nm INTO wa_src01.
IF sy-subrc = 0.
CLEAR wa_src0.
REPLACE cl_abap_char_utilities=>cr_lf(1) IN wa_src01 WITH ''.
SPLIT wa_src01 AT cl_abap_char_utilities=>horizontal_tab
INTO wa_src0-material
tmp0
wa_src0-base_uom
wa_src0-movement_type
wa_src0-cost_center
wa_src0-doc_date
wa_src0-post_date
wa_src0-plant
wa_src0-storage_location.
SHIFT tmp0 LEFT DELETING LEADING '0'.
wa_src0-consumption_qty = tmp0.
APPEND wa_src0 TO lt_src0.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLEAR wa_src0.
LOOP AT lt_src0 INTO wa_src0.
REPLACE ',' IN wa_src0-consumption_qty WITH '.'.
MOVE: wa_src0-material TO wa_srcdata-material,
wa_src0-consumption_qty TO wa_srcdata-consumption_qty,
wa_src0-base_uom TO wa_srcdata-base_uom,
wa_src0-movement_type TO wa_srcdata-movement_type,
wa_src0-cost_center TO wa_srcdata-cost_center,
wa_src0-doc_date TO wa_srcdata-doc_date,
wa_src0-post_date TO wa_srcdata-post_date,
wa_src0-plant TO wa_srcdata-plant,
wa_src0-storage_location TO wa_srcdata-storage_location.
APPEND wa_srcdata TO gt_srcdata.
CLEAR wa_srcdata.
CLEAR wa_src0.
ENDLOOP.
ENDIF.
DELETE DATASET file_nm.
ENDFORM. " application_server -
CONTAINSTABLE search fails when contains_search_condition value contains comma
DECLARE @FileText NVARCHAR(100) = '1,295';
Select F.[KEY] AS KEYWORD, F.[RANK] AS KEYRANK
FROM CONTAINSTABLE(O1234, FileText, @FileText) F
Syntax error near ',' in the full-text search condition '1,295'.
What are the full text reserved characters and how do you properly encode them so Full Text Search does not blow up?
sql2008Hello,
The comma in the condition argument may be interpret as AND. You can refer to the following statement to check if the issue presists:
DECLARE @FileText NVARCHAR(100) = '''1,295''';
Reference:http://ewbi.blogs.com/develops/2007/05/normalizing_sql.html
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support -
String containing apostrophe sign passed to text field via binded parameter from XDP displayed wrong
Hello,
I have a text field that is bound to a String field in XDP, sometimes when the field contains apostrophe sign (') generated PDF displays ' instead, for example if the value is he's it shows he's
The field format is plain text only.
The problem only appears occasionaly and rarealy and I can't find the reason and can't even reproduce it anymore.
Maby someone has encountered such problem and know the reason why it happens or conditions for it to happen and the means to fix it?I don't want to be one of those that gives meaningless advise but I'm keen to 'give back' to this forum so here goes ... maybe completely up the wrong tree ...
I'll assume you're generating the XDP on a server and then passing that to the browser as a content type "application/vnd.adobe.xdp+xml"
Have you also tried setting the character set to UTF-8 ? I use ASP and have "response.CharSet = "utf-8" " in my header. -
How To Access JSP Image file Path inside JavaBean Class
In my Webapplication,i have jsp and javabeans files. i need to send one image file path contains in Image folder to JavaBean[MyBean.java].
From MyBean i am trying to display that image using PdfGen Application[JAR] in a new PDF Document.
The Web Application Structure is as
MyWebApp
Image
\ mypic.gif
JSP
\myjsp.jsp
WEB-INF
classes
\pack.MyBean.java
My Question :
Inside the webapplication[JSP] the image file is accessed as a URL.(like http://localhost:7001/mywebapp/Image/mypic.gif). but From JavaBean: How To access this file? becz inside javabean it needs a complete system path..How to solve this problem? plz send me any solutions related to my problem....Thank U.Dear Madruguinha!
Thank you very much for your tips.
but i find another one method for accessing the image.
// Inside Servlet or JSP
String realPath=getServletContext().getRealPath("Image"+"/pic1.gif");
Now we can send this exact system path variable to any java beans or java class that needs the image path as "drivename:\foldername\filename" like "c:\myflolder\mypic.gif" and not web context path. -
I'm a new MAC user and I'm trying to transfer my iTunes music files to my Mac, however when I attach the external drive that contains the music files, the music files aren't visible on the MAC (but they are visible on my old PC). How do I get my music transferred? I have already exported the purchased music from the iTunes library, but I have thousands of songs from my private CD collection that I had previously loaded through iTunes.
Paragon Software has the most reliable NTFS driver for Mac
tips on importing and organizing, transferring from Windows etc
http://www.apple.com/support/itunes
http://www.ilounge.com -
File path defaulted to 'C:\fakepath' when attaching an original on PLM WUI
Hi,
When trying to attach an original via PLM WUI, we notice that the file path is defaulted as 'C:\fakepath' instead of the document path of the original.
We see this behaviour happening only with PLM WUI, and the functionality works perfectly fine with SAP GUI.
Any expert opinions appreciated.
Regards,
Vivek PandeyHI Vivek,
If you go to Internet Explorer; Tools; Internet Option; Security; Custom; find the "Include local directory path when uploading files to a server" (it is quite a ways down) and click on "Enable" You may have to restart your computer, but this works & eliminates that "fakepath" that inhibits the upload file path.
Regards
Abhishek Aynipully -
SIS package works in development environment but fails when job scheduler executes, file path invalid
Relatively simple package to get OLE-DB connection to MS FoxPro 9.0 DB
The failure in the job log states that the path is invalid its a network path (\\192.168.1.xxx\foldername) this has been run several ways with the remote computer being mapped as a network drive and through the \\ notation described above.
Thinking it was a security issue between the SQL agent account and my account I tested by subsitution myself as a proxy account for the agent when running this job, again same result failed on network path.
One issue I see is that the remote computer is running Server 2000 (legacy software incompatable with newer versions)
Is it possible that this is a security issue, since if i understand correctly the current MS domain security model didn't exist until Server 2003.Hi REIData,
Have you got the issue resolved? Based on your description, please make sure the target folder is shared properly. If the computer on which the SQL Server Agent job runs doesn’t join the domain as the server that hosts the shared folder, you have to share
the folder with everyone by adding “Everyone” to the people list on the File Sharing page of the folder and assign "Read/Write" permission to it.
Regards,
Mike Yin
TechNet Community Support -
Apostrophe in File Path or File Name
As most of you know, you cannot edit a file in PE8 with Photoshop CS4 if the pathname or filename contains any special characters. The file gets locked in PE8 but does not open in CS4. In my case, it is apostrophe. Renaming the directories or files is not an option for me as I have 1000's of them.
Anyone knows whether this is a priority for Adobe and whether a fix is in the works? I went from PE6 to PE8 and I truly regret it as PE6 was a very stable version.One of my users found that by right-clicking on the
attachment and selecting "Open" the file will open,
even when it has an apostrophe. It's a bit easier than
what I was having them do - Save the file or email it
to themselves. -
I am experiencing this error with one of our cluster environment. Can anyone help me in this issue.
The Cluster Service function call 'ClusterResourceControl' failed with error code '1008(An attempt was made to reference a token that does not exist.)' while verifying the file path. Verify that your failover cluster is configured properly.
Thanks,
Venu S.
Venugopal S ----------------------------------------------------------- Please click the Mark as Answer button if a post solves your problem!Hi Venu S,
Based on my research, you might encounter a known issue, please try the hotfix in this KB:
http://support.microsoft.com/kb/928385
Meanwhile since there is less information about this issue, before further investigation, please provide us the following information:
The version of Windows Server you are using
The result of SELECT @@VERSION
The scenario when you get this error
If anything is unclear, please let me know.
Regards,
Tom Li -
Packager fails with "Maximum file path name exceeded" on InCopy
Attempting to build the full suite with CCP 1.5.0 Build 83, running on Window 8.1 update 64-bit.
When building a 32-bit package it reaches InCopy it always stops and provides the so helpful "Maximum file path name exceeded error". This appears to only happen when building the 32-bit package, building the 64-bit package caused no issues, and even in building the 32-bit package after the 64-bit package when everything is already downloaded the same error occurs.
Tried it with:
Cache path: C:\Users\iholmes\AppData\Local\Adobe\CCP\
Destination path: F:\ISO\Adobe\Cloud\Working\CreativeCloud-06192014x86
Also tried:
Cache path: g:\Adobe\CCP
Destination path: f:\cc\x86
These are all local paths, not mapped network drives.Same here. From: C:\Users\<user>\AppData\Local\Temp\PDApp.log:
<errorType>LongPathError</errorType>
<filePath>C:\Users\<user>\AppData\Local\Temp\{839FDA1E-684B-4164-A8A0-AC83A4D37D3F}\AICY\ LS20\10.0\InCopy_10_LS20_Win32
I can manually extract the zip file from: C:\Users\<user>\AppData\Local\Adobe\CCP\AdobeCCPCache\AICY\LS20\InCopy_10_LS20_Win32.7z to the above path (which I think is what it's trying to do) with no error, so it seems to be something Adobe is going to have to fix.
Someone else worked around it by creating a local user with a single character as the user name: Creative Cloud Packager Keeps Failing on InDesign: "Maximum File Path Name Exceeded"
Maybe you are looking for
-
What is the Full Charge Capacity showing for your 11.6 MBA
Mine started out at around 4675 and is now at 4539 with 16 Cycles. I'd like to see if I'm in the ballpark and if not, what the users with higher capacity are doing: charging, conditioning, etc.
-
Re:GUI connection failure
Dear whoever, Ok another problem i cannot seem to get over and no-one seems to be able to come up with a solution perhaps i should put reward on this one, so here goes again. I have installed Oracle9i on a Linux9 OS (with many a problem to solve) and
-
Connecting to MySQL from an Applet
Hi ! I have some serious Problem connecting from within my Applet to a MySQL-DB. Everything is fine until i try to establish a Connection ( I use mm.mysql-driver ). The Driver seems to be correctly loaded, but when it comes to connection I get the fo
-
I bought an episode of a TV show and tried to sync it onto my iPod 5th gen. All I got was a pop-up that said something along the lines of "This episode could not be synced to your iPod because it is not compatible to be played on this iPod". I'm real
-
Migrating from windows itunes to mac itunes
covinced my mom to get a new imac. she had itunes on her windows machine so i copied the itunes folder to an external drive and have hooked it up to the mac. when i try to drag the music files to mac itunes- it won't work. when i look at file, it sho