MimeBodyPart.getFileName() returns file name with directory path.
Hi
The documentation says getFileName() returns filename ,not including directory components. But it is returning
path like Eserv generic/mails/a.html. Can it return a full path in some mail servers?
Please respond.
Thanks
The documentation says getFileName() returns filename ,not including directory components.I think you must be misinterpreting the documentation. Where did you read that?
The getFileName method returns whatever the sender sent as a file name. The send should
send only a simple file name, with no directory components, but they can send anything, and
you should protect against abuse before using such a file name.
Similar Messages
-
How to see document file name with full path when hovering mouse over title bar?
Using PS CS6, Windows 7 x64.
I was under the impression that when hovering my mouse over the document title bar, I would see a tooltip showing the full file name, including the path. This isn't happening and I'm wondering if there is a way to do this. I know I can click File > Save As, or Ctrl+Shift-S to see the full path, but hoving over the title bar would be easier. (What I am seeing now in the tooltip is the file name, % magnification and which layer I have selected. Basically, the tooltip is just showing what's in the title bar without hovering.)
Thank you!
JohnHm, I wonder if it's something they may have enabled only for the Cloud version (I have 13.1.2). If so, I didn't notice the change at the time of the upgrade.
Nope, it's not that - I have a virtual machine for testing with 13.0.1 installed... This is what I see there:
-Noel -
FM for getting teh file name with path
Hi guys,
Is there an fm getting the file name with path given the physical path and file name? Thanks!Hi Mark,
Function Module WS_FILENAME_GET is obsolete, dont use it.
Use the Method file_open_dialog of class cl_gui_frontend_services as given below.
DATA:
lt_filetable TYPE filetable,
lf_rc TYPE i,
lv_filename(50) TYPE c,
lv_fileext(3) TYPE c,
ls_file TYPE file_table,
lv_file TYPE localfile,
lv_title TYPE string.
lv_title = sy-title.
lv_progname = sy-cprog.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = lv_title
file_filter = '*.txt'
multiselection = abap_false
CHANGING
file_table = lt_filetable
rc = lf_rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
DISPLAY LIKE 'E'
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
* Number of selected filed must be equal to one.
CHECK lf_rc = 1.
* Access selected file
READ TABLE lt_filetable INTO ls_file INDEX 1.
CHECK sy-subrc = 0.
lv_file = ls_file-filename.
SPLIT lv_file AT '.' INTO lv_filename lv_fileext.
Revert back if you need clarifications.
Regards
Karthik D -
FILE NAME WITH FILE EXTENTIONS
HI EXPERTS!!
I WANT TO GET THE FULL FILE NAME STRORED IN THE SERVER FOLDER. I USED FM RZL_READ_DIR_LOCAL BUT I AM GETTING ONLY 32 DIGITS OF NAME NOT FULL NAME AND ALSO SIZE PARAMETER IS CONCATENATING WITH NAME.
I WANT THE FILE NAME WITH FILE EXTENTIONS(TXT. .PDF ETC)..
PLZ SUGGEST ME HOW TO GET THE SAME..
PLZ REPLYE ME..
MAHESHHi Mahesh,
Try the below FM in the below code.
DATA:
LV_PERMISSION(10), " Permission
LV_H2, " H2
LV_FLNM(13), " File name
LV_USER(10), " User
LV_GROUP(10), " Group
LV_SIZE(15), " Size
LV_MONTH(3), " Month
LV_DAY_C(2), " Day
LV_YEAR(5), " Year
LV_FILE_NAME TYPE FILE_NAME, " Filename
LV_JUNK, " Junk
RETURN_CODE TYPE I. " Return code
DATA:
CMD_PARAMS LIKE SXPGCOLIST-PARAMETERS,
" External prg.parameters
CMD_OUTPUT TYPE BTCXPM OCCURS 0, " Log message
STATUS TYPE EXTCMDEXEX-STATUS. " Status
CONSTANTS:
LC_DIR TYPE C VALUE 'd'. " Directory
FIELD-SYMBOLS: <CMD_OUTPUT_LINE> LIKE LINE OF CMD_OUTPUT.
CMD_PARAMS = PV_DIRECTORY.
CLEAR CMD_OUTPUT.
CALL FUNCTION 'SXPG_CALL_SYSTEM'
EXPORTING
COMMANDNAME = 'Y_LS_LN'
ADDITIONAL_PARAMETERS = CMD_PARAMS
IMPORTING
STATUS = STATUS
EXITCODE = RETURN_CODE
TABLES
EXEC_PROTOCOL = CMD_OUTPUT
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
OTHERS = 12.
Check Status first then check sy-subrc
CASE SY-SUBRC.
WHEN 0.
CASE STATUS.
WHEN 'F'.
MESSAGE I057(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 'E'.
MESSAGE I058(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 'S'.
MESSAGE I059(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 'C'.
MESSAGE I061(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
ENDCASE. " CASE STATUS.
WHEN 1.
MESSAGE I048(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 2.
MESSAGE I049(YS) WITH 'Y_LS_LN'(003).
GF_EXIT = GC_TRUE.
WHEN 3.
MESSAGE I050(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 9.
MESSAGE I054(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 10.
MESSAGE I055(YS) WITH 'SXPG_CALL_SYSTEM'.
GF_EXIT = GC_TRUE.
WHEN 11.
MESSAGE I056(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN OTHERS.
MESSAGE I022(YS) WITH SY-SUBRC.
GF_EXIT = GC_TRUE.
ENDCASE. " CASE SY-SUBRC.
IF GF_EXIT = ' '.
READ TABLE CMD_OUTPUT ASSIGNING <CMD_OUTPUT_LINE> INDEX 1.
IF SY-SUBRC = 0.
CONDENSE <CMD_OUTPUT_LINE>-MESSAGE.
IF <CMD_OUTPUT_LINE>-MESSAGE CS 'total' OR
<CMD_OUTPUT_LINE>-MESSAGE CS 'TOTAL'.
DELETE CMD_OUTPUT INDEX 1.
ENDIF.
ENDIF.
LOOP AT CMD_OUTPUT ASSIGNING <CMD_OUTPUT_LINE>.
CONDENSE <CMD_OUTPUT_LINE>-MESSAGE.
SPLIT <CMD_OUTPUT_LINE>-MESSAGE AT SPACE INTO
LV_PERMISSION
LV_H2
LV_USER
LV_GROUP
LV_SIZE
LV_MONTH
LV_DAY_C
LV_YEAR
LV_FILE_NAME
LV_JUNK.
IF LV_PERMISSION(1) = LC_DIR.
CONTINUE.
ELSE.
LV_FLNM = LV_FILE_NAME(13).
TRANSLATE LV_FLNM TO UPPER CASE.
IF LV_FLNM = '1W_FIARFUNNEL'.
PT_FILE-FILE_NAME = LV_FILE_NAME.
APPEND PT_FILE.
ENDIF. " IF LV_FLNM = '1D_FIARFUNNEL'.
ENDIF. " IF lv_permission(1) = ...
ENDLOOP. " LOOP AT CMD_OUTPUT
ENDIF. " IF GF_EXIT = ' '. -
Change file name with oreilly servlet
I am using oreilly servlet package and I want to change the file name to the file I am uploading, is this possible ?
How ?
Thanks.
here I post the servlet code:
package com.reducativa.sitio.servlets;
* DemoParserUploadServlet.java
* Example servlet to handle file uploads using MultipartParser for
* decoding the incoming multipart/form-data stream
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import com.oreilly.servlet.multipart.*;
public class DemoParserUploadServlet extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
response.setContentType("text/plain");
out.println("Demo Parser Upload Servlet");
File dir = new File("f:/");
if (! dir.isDirectory()) {
throw new ServletException("Supplied uploadDir " + "f:/ " +
" is invalid");
try {
MultipartParser mp = new MultipartParser(request, 10*1024*1024); // 10MB
Part part;
while ((part = mp.readNextPart()) != null) {
String name = part.getName();
if (part.isParam()) {
// it's a parameter part
ParamPart paramPart = (ParamPart) part;
String value = paramPart.getStringValue();
out.println("param; name=" + name + ", value=" + value);
else if (part.isFile()) {
// it's a file part
FilePart filePart = (FilePart) part;
String fileName = filePart.getFileName();
if (fileName != null) {
// the part actually contained a file
long size = filePart.writeTo(dir);
out.println("file; name=" + name + "; filename=" + fileName +
", filePath=" + filePart.getFilePath() +
", content type=" + filePart.getContentType() +
", size=" + size);
else {
// the field did not contain a file
out.println("file; name=" + name + "; EMPTY");
out.flush();
catch (IOException lEx) {
this.getServletContext().log("error reading or saving file");
}Hi there,
I am facing the same problem that you have stated in your Feb 26, 2002 10:28 AM message regarding "change file name with oreilly servlet", I would like to change the file name to include a unique identifier upon upload, did you ever find a solution to your problem?
Thanks!
Todd
[email protected] -
File name with symbols won't delete from trash.cache\trash\cache folder.
found this weird file name with symbols (squares nad the like) in the trash.cache\trash\cache folder. Can't seem to delete it from windows, can't get at from the dos prompt. Windows safe mode won't delete it.
Any suggestions as to what it is and how to get rid of it.
At present am trying reinstall of firefox and virus scan.
Thanks
PeterI tried to do the instructions Adobe gave me but when
I put in the disc that came with my mac and hold down
C when it restarts it takes me to the screen to do a
fresh install.
At that point go to the Menu & select Disk Utility - I can't remember exactly which menu but you should be able to find it easily... there isn't too much there
I went into the disk utility through the Apps folder
and for somereason the option to repair isnt
highlighted and it wont let me click it. I tried to
repair permissions/verify but it doesnt change
anything. I looked at the info and it says the volume
can be repaired, but it wont let me.
You can't Repair the disk the system is currently running the OS from - That's why you have to boot from the Installer disk (or some other start-up disk). Repair Disk addresses directory structure issues - totally separate from what Repair Permissions does.
HTH|:>)
Bob J. -
I'm trying to execute a SSIS package via SQL agent with a flat file source - however it fails with Code: 0xC001401E The file name "\server\share\path\file.txt" specified in the connection was not valid.
It appears that the problem is with the rights of the user that's running the package (it's a proxy account). If I use a higher-privelege account (domain admin) to run the package it completes successfully. But this is not a long-term solution, and I can't
see a reason why the user doesn't have rights to the file. The effective permissions of the file and parent folder both give the user full control. The user has full control over the share as well. The user can access the file (copy, etc) outside the SSIS
package.
Running the package manually via DTExec gives me the same error - I've tried 32 and 64bit versions with the same result. But running as a domain admin works correctly every time.
I feel like I've been beating my head against a brick wall on this one... Is there some sort of magic permissions, file or otherwise, that are required to use a flat file target in an SSIS package?Hi Rossco150,
I have tried to reproduce the issue in my test environment (Windows Server 2012 R2 + SQL Server 2008 R2), however, everything goes well with the permission settings as you mentioned. In my test, the permissions of the folders are set as follows:
\\ServerName\Temp --- Read
\\ServerName\Temp\Source --- No access
\\ServerName\Temp\Source\Flat Files --- Full control
I suspect that your permission settings on the folders are not absolutely as you said above. Could you double check the permission settings on each level of the folder hierarchy? In addition, check the “Execute as user” information from job history to make
sure the job was running in the proxy security context indeed. Which version of SSIS are you using? If possible, I suggest that you install the latest Service Pack for you SQL Server or even install the latest CU patch.
Regards,
Mike Yin
If you have any feedback on our support, please click
here
Mike Yin
TechNet Community Support -
Logical file name or logical path name incorrectly defined
Dear All,
We are doing archival in our IDES for test purpose before we do it to our Production.
Steps Performed
Copied AM_ASSET archive object to ZAM_ASSET
Logical Path
Logical path ZAM_ASSET
Name Asset
Syntax group UNIX Unix compatible
Physical path /archive/test/<FILENAME>
Logical File Name
Logical file ZAMASSET
Name Asset
Physical file FI_<MONTH>_<DAY>.txt
Data format ASC
Applicat.area AM
Logical path ZAM_ASSET
But when we run the WRITE though SARA , in the job log we get the following
Logical file name or logical path name incorrectly defined
When generating a file name for an archive file that is to be created, the system determined that the logical file name FIAA_ARCHIVE_DATA_FILE or the logical path name ARCHIVE_GLOBAL_PATH was defined incorrectly.
But we have maintained a Logical name ZAMASSET , so we are unable to change the location of archived file and as well as the format.
So is there any setting we need to maintain apart from the logical file name and logical file path.
Suggestions are highly appreciated.
Thanks in anticipationhi,
follow this steps :
- transaction SARA
- enter authorization objects, eg SD_VBAK
- hit button CUSTOMIZING
- Archiving Object-Specific Customizing: execute Technical Setting
- field Logical File Name enter or select ARCHIVE_DATA_FILE
- leave CONTENT REPOSITORY as blank if you are not using 3rd party for storing (eg. IBM Tivoli)
- back to customizing
- from Basis Customizing, execute : Cross-Client File Names/Paths
- on Logical FIle Path Definition, highlight (select) ARCHIVE_GLOBAL_PATH on the right pane
- double click on the Assignment of Physical Paths to Logical Path on the left pane
- double click on OS used, eg. UNIX, define Physical Path where archive file (on WRITE process) will be stored
- save changes made
- double click Logical File Definition, Cross Client on the left pane
- double click ARCHIVE_DATA_FILE on the right pane
- make sure that logical path is already set to ARCHIVE_GLOBAL_PATH
- save changes made
this setting also can be done using transaction FILE
we have experienced on this case using SAP standard archiving (SARA, SARI) and everything is fine with this setting above.
hope it help you.
rgds,
Alfonsus Guritno -
Dynamic File Name and Directory File Sender Adapter
Hello gurus,
I have a question: Is there any way to make the File Name, and Directory Dynamic of a File Sender Communication Channel ?
For example, taking it as a parameter from a Web Service Request.. (I mean, the only way with this would be a ccBPM). I don't exactly know if there is a way, I just thought about this.
Please tell me if someone could make Dynamic these 2 parameters while picking a file.
Regards,
Juanoops,thought i was replying to the PgP question:)
I think you should be able to achieve this via adapter module but i m not really sure how exactly it will be done .
Thanks
Aamir
Edited by: Aamir Suhail on Jul 28, 2009 1:42 PM -
Re number of characters in a file name with leopard.. 10.5.3
re number of characters in a file name with leopard.. 10.5.3
Is there a limit? in a file or directory name?hfs+ == hfs extended, the default filesystem on a current mac...
http://en.wikipedia.org/wiki/HFS_Plus -
I am using OSX 10.9.5 and Outlook Web App for emails. When I download an attachment it replaces the space in the file name with %20 - how can I change this?
Click on the below link :
https://get.adobe.com/flashplayer/otherversions/
Step 1: select Mac OS X 10.6-`0.`0
Step 2 : Safari and FIrefox
Then click on " Download Now" button. -
File name with Dateand time stamp.
Hi All,
I want to generate a file with a date and time stamp.
For that in File Receiver adaptor i am using option "Add Time Stamp" in File Construction mode. however it is generationg file name as: FileName_20082104_121211_645.txt . In this I don't know what these last three characters "_645" are? And In the File name i only want a file name with datetime stamp . I don't require underscore in between. for eg: FileName_20082104121211.txt (FileName_dateTime.txt)
Can anybody suggest me the way to achive this?
Thanks,
Atul@FileName_20082104_121211_645
The date time stamp in XI's file adapter will be in that format. This is to avoid over writing of files created simultaneously at the same time. So the last 3 digits is a form of an unique id to distinguish between the same.
In case you want the format as FileName_20082104_121211, use the dynamic configuration and create the file name inside the mapping itself and pass it across.
To get an idea about the same, ref:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - an usage of the same.
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm -
Using the regex to match the file name with date time
Hello all,
currently I had problem to match the following file name with the date time. Of course I can use this regex like ""(\\\\w+|.+).(zip)" to match it. However in the current application i need to parse the file name and get the current date time to check if it is matched. Does anyone have good idea?
{code}
testfile10-08-09-2008-08-21-04-24-0443.zip
testfile11-08-09-2008-08-22-04-24-0441.zip
{code}
thanks in advanced!lauehuang wrote:
Hello all,
currently I had problem to match the following file name with the date time. Of course I can use this regex like ""(\\\\w+|.+).(zip)" to match it.That regex doesn't make a lot of sense:
- with "\\\\w" you probably meant "\\w";
- "\\w+|.+" doesn't make sense: you can simply do ".+" in that case;
- ".(zip)" will also match the string "%zip" or "Ezip".
However in the current application i need to parse the file name and get the current date time to check if it is matched. I don't know what you mean by that. -
Encoding failed in "file name" with error: -43
Hi!
I've tried everything but still, after about 20 hours of encoding DVD Studio Pro just stoppes, saying "encoding failed in "file name" with error: -43". The movie is in DV PAL format and made in Final Cut Pro version 5. I'm using DVD Studio Pro 4.0. The movie is about 1 hour and 30 minutes long and I'm trying to put it on a double layer DVD. I've tried to shorten it (it was nearly 2 hours before), but that didn't help. I also tried to shorten it even more and put it on a single layer DVD, but still the same message.
So if somebody has any idea of how I can solve this problem, please let me know as soon as possible!
Thank you!Error -43 means "File not found." If you are compressing from a reference movie, make sure that all referenced movie clips are present on the disk and that permission settings are not preventing DVD Studio Pro from accessing them.
Error -1309 means "Out of bounds." This means that the source file is pretending to be bigger than it actually is.
So it sounds like there are issues with your source movie.
P.S. Compressor has a much better MPEG-2 encoder and I would recommend using that instead. -
when I open up an e-mail attachment a box pops up PRINT TO FILE below that line OUTPUT FILE NAME with an empty line for the file name vs. simply going to my default printer?
Make sure that '''''Print to File''''' isn't selected in the native print dialog box ''(see screenshot below)'' middle-right, and make sure your Printer is selected at the top of that dialog box.
''I'm a little confused why an email attachment would need to go directly to the printer, but that's what you asked about.''
Maybe you are looking for
-
Upgrading Server Memory - Need to adjust Oracle DB Memory?
I have created a test database under Windows Server 2003 with 1GB of RAM. Now, we are planning to increase Server memory to 4GB. My question is, do I need to configure something on the Oracle DB? I am running Oracle 10G
-
How to use Scrollbar in Tray UI
Hello, I want to use scroll bar inside a tray UI Element. I tried using the scrolling mode property of tray but no scrollbar appeared. I am trying to do this using dynamic coding. Can someone help me in this?? Thanks and Kind Regards, G Singh.
-
Why does SHIFT+CLICK to select/append selection in STP work *so badly*?
This drives me absolutely crazy. It's the one thing one needs to do in this application and it works appallingly. I have an area selected of my waveform. I want to add a little more from along the timeline, or trim the selection a bit. I hit SHIFT+CL
-
Object position controlled by time
So, i want to control the position of a white box by using expressions because i can't use keyframes as i want (or i'm just stupid). I already have a = thisComp.layer("White box").effect("Sound Keys")("Output 1")*1; b = thisComp.layer("White box").ef
-
Background picture missing when post at non .mac-server
Hi, I am new at this so you have to excause me if I ask stupid qustions. I've just made a homepage using Iweb. When published at: http://web.mac.com/katamaleegarden/ it looks the way I want it to look, when published at: http://maleegarden.com the ba