Check if filename is correct
hey guys,
when I upload a file using my bsp page, I need to check if the filename is correct,
right now I have the following code:
num_multiparts = request->num_multiparts( ).
while i <= num_multiparts.
entity = request->get_multipart( i ).
value = entity->get_header_field( '~content_filename' ).
if not value is initial.
found a file!
navigation->set_parameter( name = 'content_filename'
value = value ).
I try to check the filename as follows, but this doesn't work:
filenamecheck = navigation->get_parameter( name = 'content_filename').
if filenamecheck ne 'RU_BRA_PRO.CSV' .
navigation->goto_page( 'select_country.htm' ).
endif.
It should be as simple like that, but in some way, it just loops over this. It makes no difference if my value is correct or not, it just ignores the navigation->goto_page( 'select_country.htm' ). , no mather if the IF-condition is true or not...
here is my full code... this BSP is bugging me like hell
event handler for checking and processing user input and
for defining navigation
file upload and echo
data: entity type ref to if_http_entity,
file type string,
filenamecheck type string,
content_type type string,
content_length type string,
num_multiparts type i,
i type i value 1,
doEcho type string,
value type string.
find multipart containing file
num_multiparts = request->num_multiparts( ).
while i <= num_multiparts.
entity = request->get_multipart( i ).
filenamecheck = entity->get_header_field( '~content_filename' ).
value = entity->get_header_field( '~content_filename' ).
if not value is initial.
found a file!
navigation->set_parameter( name = 'content_filename'
value = value ).
content_type = entity->get_header_field( 'Content-Type' ).
navigation->set_parameter( name = 'content_type'
value = content_type ).
get file content
file = entity->get_cdata( ).
get file size
content_length = xstrlen( file ).
navigation->set_parameter( name = 'content_length'
value = content_length ).
TRANSLATE filenamecheck TO UPPER CASE.
if file_name ne 'RU_BRA_PRO.CSV' .
navigation->goto_page( 'select_country.htm' ).
endif.
data: data_TAB type table of string, LIN TYPE LINE,fname type string.
split file at CL_ABAP_CHAR_UTILITIES=>CR_LF into table data_TAB.
fname = '/usr/sap/CBD/DVEBMGS03/data/RU_BRA_PRO.CSV'.
OPEN DATASET fname FOR OUTPUT in TEXT MODE encoding default.
if sy-subrc gt 0.
WRITE: / 'Error opening file'.
endif.
LOOP AT data_TAB INTO LIN.
TRANSFER LIN TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.
exit.
endif.
i = i + 1.
endwhile.
if doEcho is not initial.
signal to the BSP runtime that the response data is
complete and no onLayout method should be called to
create the response
navigation->response_complete( ).
else.
navigation->goto_page( 'end_upload.htm' ).
endif.
Similar Messages
-
I purchased a IMac in Feb later I added a Seagate ext. hard drive. On April 29 I received an errors that the ext. Drive may be a read only and not backing up files. I'm unable to check disk permission or correct errors. Help would be appreciated.
Click on the hard drive on the desktop, then File > Get Info. What does it say about permissions? If this is just a data drive you may want to consider "ignore ownership on this volume".
Otherwise I can only say I have not been reading good things about Seagate drives recently. I have some of their rock-solid ones from about 10 years ago (still running well), but now...? -
Firefox Plug-In Checker is not working correctly, can I stop it from running?
Firefox Plug-In Checker starts every time I start Mozilla. However, it keeps showing the same plug-ins each time as being not updated. I update every time but it still keeps coming back. Can I disable the plug-in checker?
You can correct this issue by forcing the file blocklist.xml to update or wait until Firefox updates the file.<br />
That update will remove the severity="0" flags in the file that cause the problem.
See:
* [/questions/832793?page=2#answer-198407]
* http://forums.mozillazine.org/viewtopic.php?p=10899869#p10899869
*[https://bugzilla.mozilla.org/show_bug.cgi?id=663722 Bug 663722] - The blocklist output is including severity="0" where it shouldn't be -
How can I check photoshop is giving correct colour screen display ?
Hi,
I photograph a bright red car in raw mode on a digital slr (Canon 20D) set to Adobe rgb 1998 and view it in BreezeBrowser and it looks just as I remember it. I open it into Pshop CS5 extended (which is set to Adobe rgb1998, Europe ISO Coated Fogra27, (as I am UK and this is what a calibration company set our works proofer to) gray gamma 2.2 dot gain 20% and its become a little desaturated. Sampling it and comparing screens and colours with BreezeBrowser its definitley less red, a bit more orangey red instead. I need to up saturation to return the red, both in RAW converter and also after image opened if not done so beforehand in RAW converter.
Colours just look muted.
What tests can I carry out to find out what is going on ?
Perhaps create a rgb 255 0 0 image in a way not influenced by photoshop and photo the monitor, then open this in photoshop and sample it. However that would be influenced by the exposure of the camera. Maybe I need to create a kodak grey card type image and establish correct exposure for the monitor brightness first. so what would that be as rgb ?
Any other ideas ?
I know though that Pshop is displaying duller. Once upon a time we had Adobe gamma and one would go through the calibration wizard to set up photoshop having already set up the monitor.
What do we have to do after installing CS5 extended or CS4 to ensure Pshops display is correct ?
I have Adobe gamma in the control panel, Is this something we still have to do in CS5, I wonder if its there because I still have Pshop 7 installed which used that wizard.
XP pro is my OS.
EnvirographicsHow can I check photoshop is giving correct colour screen display ?
Photoshop Monitor & Profile Image(link)
a big tip - why colors in Photoshop look different in other applications - is:
View> Proof Setup: Monitor RGB
that should duplicate what the other apps are displaying (the RGB numbers are going straight to the monitor with no color adjustment) - Photoshop converts/adjusts source colors to the monitor profile for a so-called 'true-color' display... -
After my macbook was serviced, when I tried to open CS6, it prompted me to key in the serial number. After keying in, I got error message saying the serial number is invalid. However I have checked that it is correct.
First be sure login and password are OK. Sometimes the address starts wit "http://..." and sometime starts with "ftp://...". Try both normal FTP access and Scure FTP access (SFTP). At the end, contact the site's provider.
-
trying to rent or purchase a movie. System keeps asking for my password (which I check everytime to be correct) but you keep asking for it. Sometimes it happens and some times not.
Please note that you are addressing a user forum and not apple themselves.
Honestly, from experience however, if it asks you for the password again, the previous one was likely incorrect. Maybe a typo... -
I can't get e-mails on iPod touch 1st gen. Error message that I have eithermy password or username is incorrect. Checked settings both are correct. Can get e-mails on iPad
Try deleting the account from the iPod and reentering the settings. It is easy to make an error and notbe able find it.
-
I am having trouble logging into my iTunes Account. When it ask me to verify my payment information. I verify that all the information is correct and press the done tab and get back this error message " Please contact iTunes support to complete this tranaction". What do I need to do to correct this problem because I can't buy anything with this problem? I have also made sure I have the latest version of iTunes.
check all payment parts are filled in and u have endered you last 3 digs on back on card used to set up account
if using an other computer make sure all fileds are right and filled in
and u enter to itunes sec code -
Can check the scheduler is correct
{BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'my_job1',
job_type => 'PLSQL_BLOCK',
job_action => ' DECLARE
Type ty_tab1 is table of tb_fn%rowtype index by PLS_INTEGER;
ltab1 ty_tab1;
BEGIN
DELETE FROM tb_snap;
SELECT *
BULK COLLECT
into ltab1
FROM tb_fn;
FOR i in ltab1.first..ltab1.last
LOOP
INSERT
INTO tb_snap(user_id
,trans_id)
VALUES(ltab1(i).user_id
,ltab1(i).trans_id);
END LOOP;
COMMIT;
END;',
start_date => '17-DEC-12 1.00.00AM US/Pacific',
repeat_interval => 'FREQ=Monthly',
enabled => TRUE
END}
{my requirement is
Create a script to update the tb_snap table, update involves
1. truncating the table in tb_snap table
2. Inserting the data from tb_fn table to tb_snap table.
3. This should be done on the last day of the month for every month.
{kinly help me out now to solve the error}{BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'my_job1',
job_type => 'PLSQL_BLOCK',
job_action => ' DECLARE
Type ty_tab1 is table of tb_fn%rowtype index by PLS_INTEGER;
ltab1 ty_tab1;
BEGIN
DELETE FROM tb_snap;
SELECT *
BULK COLLECT
into ltab1
FROM tb_fn;
FOR i in ltab1.first..ltab1.last
LOOP
INSERT
INTO tb_snap(user_id
,trans_id)
VALUES(ltab1(i).user_id
,ltab1(i).trans_id);
END LOOP;
COMMIT;
END;',
start_date => '17-DEC-12 1.00.00AM US/Pacific',
repeat_interval => 'FREQ=Monthly',
enabled => TRUE
END}
{my requirement is
Create a script to update the tb_snap table, update involves
1. truncating the table in tb_snap table
2. Inserting the data from tb_fn table to tb_snap table.
3. This should be done on the last day of the month for every month.
{above i mentioned the requirements based on it, i wrote code for it, but i ever created dbms_scheduler so i dont no whether the code is correct for the requirement. any1 can help me to check} -
Unable to check-in excel file correctly
Hi,
I checked-in a spreadsheet(.xls) to cs as type 'Document - Any generic document',and I was able to check-in but I faced below issue.
The document was not searchable. When I checked-in the .xls file, the document went to GenWWW status, I resubmitted it from repository browser, and it showed me the following error:
Indexing aborted. unable to index metadata only. This may indicate the collection is damaged.
I noticed that the web location was pointing to an error page in cs.
So, can anyone please help me with checking-in an excel file into cs? Why is this issue coming up?
Even when i checked-in a .csv format file, the document was not searchable.
Note: We have IBR disabled in our system as we don't use it, still other some files(.xml etc) also get stuck in Genwww status and remain there till they are resubmitted. That's also another issue.Hi ,
It looks to be a case of indexer problem on your UCM environment . Enable indexer* tracing with full verbose and capture server output with a new excel file check-in .
Thanks,
Srinath -
When I am on a website and need to download a PDF it tells me I need to get latest update of Adobe Reader. So I get latest update (God knows how many times now) but still cannot open the PDFs - any suggestions?
This is probably because the websites you are visiting have bad Javascripts to check the version of Acrobat but can you screenshot the error that you receive and the post it?
-
why is my serial number not working, it says it is invalid. I have checked and it is correct
The most likely explanation is that you downloaded the Creative Cloud version of Lightroom instead of the standalone version of Lightroom (which you can download from here).
If that doesn't work, you'd need to provide a lot more details, including version of Lightroom, operating system, and exactly what you are doing that doesn't work. -
Check boxes not responding correctly in form.
I've created a form in forms central. Then I used XI to edit more fields. I have 7 check boxes grouped together. They are required and have a min. of 1 and max of 7. They are allowed to check as many as they wish. But when they hit the submission of the form it is allowing it to be submitted with those boxes left empty. What else can I do?
This is probably due to the following user preference: Acrobat > Preferences > Page Display > Rendering > Enhance thin lines
You should deselect it. -
HT204380 I can't use Facetime. Checked all settings are correct.
I cant use Facetime. I see the missed calls. I can't place a call either. Confirmed settings are correct following the troubleshooting guide. My WiFi works fine (can send text /o issues). My contacts are all iPhone users.
Thanks for your reply. Since posting this I somehow managed to create an IMAP account on my phone and everything is coming through npow!!
I don't know what i did but it's working.
FYI I'm with Sky,com and a password is required. No error messages were being received.
Thanks -
hi,
I'm using a code where I'm trying to get the filenames of previous databases from a folder named 'BE' into a combo box as list.
The files name are :
Data1213.accdb
Data1314.accdb
and so on. But I'm getting only "Data" not "Data1213.accdb".
Code:
====================
Dim fso As New FileSystemObject, sFile As Scripting.File
Dim sourceFolder As Scripting.Folder
Set sourceFolder = fso.GetFolder(CurrentProject.Path & "\BE")
For Each sFile In sourceFolder.Files
If right(sFile, 6) = ".accdb" And DCount("*", "tblDbase", "fileName = '" & sFile & "'") = 0 Then
DoCmd.SetWarnings False
CurrentDb.Execute "Insert Into tblDbase(filename) Select '" & sFile & "'"
End If
Next
DoCmd.SetWarnings True
====================
Note: The same code was working in Access 2003 but not in Access 2013. I don't understand. Please guide....
Thanks & Regards, Anuj MehrotraWhy insert values into a table rather than directly into the combo box's list? e.g. in the form's Open event procedure:
Dim ctrl As Control
Dim strFileName As String
Set ctrl = Me.YourComboBoxName
strFileName = Dir(CurrentProject.Path & "\BE\*.accdb")
With ctrl
.RowSourceType = "Value List"
.AllowValueListEdits = False
Do Until Len(strFileName) = 0
.AddItem strFileName
strFileName = Dir()
Loop
End With
Ken Sheridan, Stafford, England
Maybe you are looking for
-
Device drawing too much power...?
Am trying to charge my original iPhone and both the wall charger as well as computer (mac) do not seem to allow it to charge. When I plug into my computer, I get an error message that says: +Because a USB device was drawing too much power from your c
-
Tecra S2 can not switch to external display
With my Tecra S2 and when docked in APR-III replicator, I used to be able to connect my external screen (through DVI) so that it was automatically switching screen output to it by default, not only at startup screen of windows (yes I noted the forum
-
How to stop looping in ActionScript 3.0 document?
Please bear with me, as I am extremley new to this ( i.e, I started yesterday). I had wanted to just create a simple button that would allow me to move through 4 frames. Since I wasn't sure how to do this, I followed this tutorial : http://http://www
-
I was online, the page I was on redirected me to another site. when that happened my bar changed. The space on the left totype in words to search disappeared as did the arrows on the left side of the bar.
-
Like operator not passed to database for nvarchar(max)
From Crystal Reports 2008 I need to do a keyword search against a data type of nvarchar(max). I am using the LIKE operator in my record selection formula. When I do a SHOW QUERY the LIKE condition is omitted from the where clause. This makes the repo