View Full Version : Attachments
vegaslaptop
01-03-2008, 09:41 PM
Hello everyone,
I am having some issues with attachments. I created folder "attachments" in the root directory of /support with chmod 777. In the Admin Panel I assigned folder "attachments" but it fails on me when I try to save the setting. I figured out it should be in the upper directory so in the Admin Panel I put "../attachments" instead. I saved and went to test it out and it did not work. It gave me this error:
Warning: move_uploaded_file(attachments/D9B2156F24F6900_all.txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/XXXXX/public_html/support/include/class.ticket.php on line 684
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpZ7RQsF' to 'attachments/D9B2156F24F6900_all.txt' in /home/XXXXX/public_html/support/include/class.ticket.php on line
At this point I deleted the "attachments" folder from /support and put it in /support/scp with all access. In Admin Panel I changed the directory to save from "../attachments" to "attachments". So far so good but it gave me again the same error.
Then I just added the "attachments" directory to /support and I attached without error. I went to view the open ticket and when I clicked on it I am getting "No such file" error.
Apparently, the file was attached in /support/attachments but the link is looking at /support/scp/attachments. I have limited knowledge in PHP so any help will be appreciated.
Thanks
peter
01-04-2008, 02:38 AM
you have the directory path wrong. Provide the full path e.g /home/XXXXX/public_html/support/attachments That said I would recommend having the attachment directory outside the web server path. e.g /home/XXXXX/ost_attach
Pointers include;
1) Attachment dir should be outside the web server path
2) Add a plain index.html file to avoid directory listing
3) Use a hard to guess directory name esp. if #1 is not possible.
vegaslaptop
01-07-2008, 09:52 PM
Thanks Peter! This fixed my attachments issue and thanks again for the advice!
Marian
queen
01-22-2008, 10:14 AM
I too am having trouble setting up the attachments option.
Can the attachments folder be on a different domain?
Or does it need to be on the domain where I installed osticket?
In osticket under the admin pannel --> settings --> attachments
in the 'attachment folder' do I put the "http"?
or just the "/home/xxx/public_html/........"
On your next revision of osticket, can you put more explanation in the settings area?
thanks,
Christina
queen
01-22-2008, 10:29 AM
I got it figured out
it's the /home/xxx/public_html path for the attachments!
:) Christina
marked_up
01-23-2008, 12:26 PM
Peter,
I followed your directions as listed below. However my ignorance is an obstacle. I have created a folder in the root directory with full permissions (777) and an index.html but am not quite sure how to interpret the path nomenclature you have listed below. I understand that XXXXX is the domain name? In the settings section I have /home/domain-name/attach.
Thanks for your help.
marked_up
you have the directory path wrong. Provide the full path e.g /home/XXXXX/public_html/support/attachments That said I would recommend having the attachment directory outside the web server path. e.g /home/XXXXX/ost_attach
Pointers include;
1) Attachment dir should be outside the web server path
2) Add a plain index.html file to avoid directory listing
3) Use a hard to guess directory name esp. if #1 is not possible.
The path to your directory is different on every server. For you it can easily be something else than /home/???/etc.
Use phpinfo() to view your path (DOCUMENT_ROOT). You can also do an echo with $_SERVER['DOCUMENT_ROOT'].
Hope that helps.
marked_up
01-23-2008, 01:39 PM
4ice,
Thanks for the help. You made it real easy for a true PHP newbie.
Later.
The path to your directory is different on every server. For you it can easily be something else than /home/???/etc.
Use phpinfo() to view your path (DOCUMENT_ROOT). You can also do an echo with $_SERVER['DOCUMENT_ROOT'].
Hope that helps.
no1knows
04-30-2008, 03:55 PM
The path to your directory is different on every server. For you it can easily be something else than /home/???/etc.
Use phpinfo() to view your path (DOCUMENT_ROOT). You can also do an echo with $_SERVER['DOCUMENT_ROOT'].
Hope that helps.
I tried to echo this on the index of my client page and I got a response of:
"/usr/local/apache/htdocs"
but I don't know where to go from there.
My actual support page is located at:
http://***.*******.com/~deftone/support/index.php
From this info can someone tell me what path to enter if I put the folder in the root of the "support" folder? I tried every combination I can think of and it still doesn't work. I have attachment folders created pretty much everywhere on my server with write permissions trying to get this to work.
I don't understand why the path has to entered strictly a certain way. I tried to enter this path but it doesn't work even though it is valid and writeable.
http://***.*******.com/~deftone/support/attachments
Did you set the path to:
/usr/local/apache/htdocs/~deftone/support/attachments/
If this doesn't work, can you see if the ~ perhaps is giving some problems?
no1knows
05-06-2008, 12:53 PM
Did you set the path to:
/usr/local/apache/htdocs/~deftone/support/attachments/
If this doesn't work, can you see if the ~ perhaps is giving some problems?
I tried that but it keeps saying: "Invalid upload dir" and "Directory must be valid and writeable".
I think it might be the "~" symbol because I had the same problem when I installed an older version of osTicket via Fantastico. I believe it was version 1.3 and in order to get my attachments working I had to edit a file that had something to do with validation. I found that info here and I had it working for a day until I realized that version was too buggy and there was already version 1.6 out so I upgraded.
Can you please tell me which file/line # I need to edit to allow "~" in URLS? If that doesn't work maybe I'll have to wait for a new version.
no1knows
05-12-2008, 05:35 PM
Since I couldn't fix this problem using the admin pages I resorted to manually editing the database. I changed the entry for "upload_dir" to:
/usr/local/apache/htdocs/~deftone/support/attachments/
Then I tried uploading an attachment and it does not shows up anywhere. I changed the upload_dir location back to just simply "attachments" and my attachments get uploaded again, albeit not in the right place. What is wrong with my URL? I will contact my webhost to see if they can help me spot my mistake.
So you are saying that if you enter only "attachments" as a path the attachments get uploaded but not in the right place? Where exactly are they uploaded then? Inside the scp folder?
no1knows
05-13-2008, 12:00 PM
So you are saying that if you enter only "attachments" as a path the attachments get uploaded but not in the right place? Where exactly are they uploaded then? Inside the scp folder?
They upload to the /support/attachments/ folder when clients add an attachment and when staff add an attachment it goes to /support/scp/attachments folder. This means staff can't see client attachments and clients can't see staff attachments. I don't know if I mentioned that I have three folders for attachments set up.. the other folder is outside the path for the software..
I asked my webhost what to do and they said use "../attachments" but apparently they didn't read the part where I asked for the full path.. I'm gonna ask them if they can verify if this path is correct or not ->
/usr/local/apache/htdocs/~deftone/attachments/
no1knows
05-13-2008, 01:07 PM
/home/deftone/public_html/attach
That was the correct path. I realized it when I was in the online file manager "Editing /home/deftone/public_html/support/include/client/viewticket.inc.php..."
when I glanced at that line it finally struck me. I can't believe how stupid I was before. Thanks for all your help 4ice. Hope this helps someone as clueless as me in the future.
/home/deftone/public_html/attach
That was the correct path. I realized it when I was in the online file manager "Editing /home/deftone/public_html/support/include/client/viewticket.inc.php..."
when I glanced at that line it finally struck me. I can't believe how stupid I was before. Thanks for all your help 4ice. Hope this helps someone as clueless as me in the future.
I'm glad that it is solved now.
I will close the thread, but it still remains visible for people who perhaps need this info.